Ayy it might work

This commit is contained in:
LAX18 Development
2021-01-12 11:12:29 -05:00
parent 4f9e145b68
commit ef607b8d7a
+2 -2
View File
@@ -21,7 +21,7 @@ def readVoltage(bus):
read = bus.read_word_data(address, 2)
swapped = struct.unpack("<H", struct.pack(">H", read))[0]
voltage = swapped * 1.25 /1000/16
print(typeof voltage)
print(voltage)
return voltage
@@ -31,7 +31,7 @@ def readCapacity(bus):
read = bus.read_word_data(address, 4)
swapped = struct.unpack("<H", struct.pack(">H", read))[0]
capacity = swapped/256
print(typeof capacity)
print(voltage)
return capacity
@app.route('/battery',methods = ['POST','GET'])