File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 1
- Coming Soon
1
+ Introduction
2
2
============
3
3
4
4
.. image :: https://readthedocs.org/projects/sparkfun-circuitpython-qwiicrelay/badge/?version=latest
Original file line number Diff line number Diff line change @@ -55,21 +55,21 @@ def test_i2c_write(addr):
55
55
56
56
try :
57
57
while True :
58
- found = []
58
+ found = []
59
59
60
- # scan through all possible i2c addresses doi
61
- for address in range (0x03 , 0x80 ):
62
- if (test_i2c_write (address )):
63
- found .append (address )
60
+ # scan through all possible i2c addresses doi
61
+ for address in range (0x03 , 0x80 ):
62
+ if (test_i2c_write (address )):
63
+ found .append (address )
64
64
65
- if ( len ( found ) > 0 ) :
66
- print ('I2C addresses found:' ,
67
- [hex (device_address ) for device_address in found ])
68
- else :
69
- print ('No I2C device found.' )
65
+ if found :
66
+ print ('I2C addresses found:' ,
67
+ [hex (device_address ) for device_address in found ])
68
+ else :
69
+ print ('No I2C device found.' )
70
70
71
- # wait a bit and scan again
72
- sleep (5 )
71
+ # wait a bit and scan again
72
+ sleep (5 )
73
73
74
74
except KeyboardInterrupt :
75
75
pass
You can’t perform that action at this time.
0 commit comments