Clean up a little

This commit is contained in:
James Bowman 2019-02-25 07:06:31 -08:00
parent 1095bc3059
commit f562231c49
1 changed files with 2 additions and 4 deletions

View File

@ -13,8 +13,6 @@ https://electricdollarstore.com
""" """
import sys import sys
import struct
import time
from i2cdriver import I2CDriver, EDS from i2cdriver import I2CDriver, EDS
@ -23,8 +21,8 @@ if __name__ == '__main__':
magnet = EDS.Magnet(i2) magnet = EDS.Magnet(i2)
led = EDS.LED(i2) led = EDS.LED(i2)
led.rgb(0, 0, 0)
while 1: while True:
(x, y, z) = magnet.measurement() (x, y, z) = magnet.measurement()
r = max(0, min(255, (x + 4000) // 32)) r = max(0, min(255, (x + 4000) // 32))
g = max(0, min(255, (y + 4000) // 32)) g = max(0, min(255, (y + 4000) // 32))