File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,37 +45,37 @@ def i2c_write_byte(byte):
4545 for i in range (8 ):
4646 sleep (DELAY )
4747 GPIO .output (SCK , 0 )
48-
48+
4949 if byte & 0x80 :
5050 GPIO .output (SDA , 1 )
5151 else :
5252 GPIO .output (SDA , 0 )
53-
53+
5454 sleep (DELAY )
5555 GPIO .output (SCK , 1 )
56-
56+
5757 byte <<= 1
58-
58+
5959 sleep (DELAY )
6060 GPIO .output (SCK , 0 )
6161 GPIO .output (SDA , 0 )
62-
63-
62+
63+
6464data = [
6565 (old_address + 0x60 ) << 1 ,
6666 0x61 | (old_address << 2 ),
6767 0x62 | (new_address << 2 ),
6868 0x63 | (new_address << 2 )
6969]
70-
70+
7171GPIO .output (SDA , 0 )
7272sleep (DELAY )
7373
7474i2c_write_byte (data [0 ])
7575i2c_ack_byte ()
7676
7777i2c_write_byte (data [1 ])
78- input ('Insert jumper J1 and press enter' )
78+ input ('Insert jumper J1 for older modules and J3 for newer modules and press enter' )
7979i2c_ack_byte ()
8080
8181i2c_write_byte (data [2 ])
You can’t perform that action at this time.
0 commit comments