diff options
| -rw-r--r-- | eeprom_pi.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/eeprom_pi.py b/eeprom_pi.py index 2b46892..e51f4b8 100644 --- a/eeprom_pi.py +++ b/eeprom_pi.py @@ -46,6 +46,8 @@ def init_board(write = True): def read_data(): + GPIO.output(3, False) + time.sleep(0.3) data = (GPIO.input(11)) print(GPIO.input(11)) data |= (GPIO.input(12) << 0x1) @@ -63,6 +65,8 @@ def read_data(): data |= (GPIO.input(7) << 0x7) print(GPIO.input(7)) print("read data: %s" % data) + time.sleep(0.3) + GPIO.output(3, True) return data # data should be one byte @@ -123,7 +127,5 @@ def read_data_at(address): # wait a little bit so the address is stable time.sleep(0.3) # trigger output enable - GPIO.output(3, False) data = read_data() - GPIO.output(3, True) print("read data %s" % data) |
