Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jamesbowman/i2cdriver
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbowman committed Mar 18, 2019
2 parents c2c258a + b839aa1 commit c8566b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions python/samples/EDS-TEMP.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit c8566b9

Please sign in to comment.