Merge branch 'master' of github.com:jamesbowman/i2cdriver
This commit is contained in:
commit
c8566b9516
|
@ -36,7 +36,13 @@ On Linux cross-compile ``i2ccl``:
|
|||
cd c
|
||||
make -f win32/Makefile
|
||||
|
||||
On Windows build the GUI executable using ``pyinstaller``:
|
||||
On Windows first make sure that you can run the GUI on the command-line, e.g.
|
||||
|
||||
python python\samples\i2cgui.py
|
||||
|
||||
(You may need to install i2cdriver, wxPython and pySerial).
|
||||
|
||||
Then build the GUI executable using ``pyinstaller``:
|
||||
|
||||
cd python\samples
|
||||
pyinstaller --onefile --windowed --icon=../../images/i2cdriver.ico i2cgui.py
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import sys
|
||||
import time
|
||||
|
||||
from i2cdriver import I2CDriver, EDS
|
||||
|
||||
if __name__ == '__main__':
|
||||
i2 = I2CDriver(sys.argv[1])
|
||||
|
||||
d = EDS.Temp(i2)
|
||||
for i in range(20):
|
||||
celsius = d.read()
|
||||
fahrenheit = celsius * 9/5 + 32
|
||||
sys.stdout.write("%.1f C %.1f F\n" % (celsius, fahrenheit))
|
||||
time.sleep(.1)
|
Loading…
Reference in New Issue