Fix: 修复MicroPython MixGoAI和Microbit下一些py异常同时格式化代码

This commit is contained in:
王立帮
2024-12-03 10:36:49 +08:00
parent e6c9a30bdc
commit ee04dadb66
71 changed files with 3265 additions and 2382 deletions

View File

@@ -7,21 +7,22 @@ _B = 3950
_T1 = 273.15 + 25
_R1 = 100
def read(pin, r1, b, rs):
r1 = r1 / 1000
rs = rs / 1000
# print("rs:" + str(rs))
_analogValue = pin.read_analog()
_voltageValue = (_analogValue / 1545) * _VOLTAGE_POWER
# print("voltageValue:" + str(_voltageValue))
_rt = ((_VOLTAGE_POWER - _voltageValue) * rs) / _voltageValue
# print("rt:" + str(_rt))
_tempValue = (((_T1 * b) / (b + _T1 * math.log(_rt / r1))) - 273.15)
return _tempValue
_tempValue = ((_T1 * b) / (b + _T1 * math.log(_rt / r1))) - 273.15
return _tempValue