1
0
mirror of https://github.com/xtacocorex/CHIP_IO synced 2025-07-20 21:03:22 +00:00

Fixing issue with the enable 1.8v pin code. Updating version to 0.2.7

This commit is contained in:
Robert Wolterman
2017-01-03 00:07:40 +00:00
parent 1d641ecdff
commit d0ed4665aa
4 changed files with 8 additions and 3 deletions

View File

@ -35,7 +35,7 @@ def set_1v8_pin_voltage(voltage):
return False
if voltage < 1.8 or voltage > 3.3:
return False
voltage=round((voltage - 1.8) / 0.1) << 4
voltage=int(round((voltage - 1.8) / 0.1)) << 4
if subprocess.call(["/usr/sbin/i2cset", "-f", "-y" ,"0", "0x34", "0x90", "0x03"]):
return False
if subprocess.call(["/usr/sbin/i2cset", "-f", "-y", "0", "0x34", "0x91", str(voltage)]):