From a34ee32c743b35170777038a4c3ebbabf5686b43 Mon Sep 17 00:00:00 2001 From: Benedict Date: Mon, 16 Apr 2018 10:23:49 +0200 Subject: eeprom: control logic: define instructions layout and write out script --- 7seg-hex.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to '7seg-hex.py') diff --git a/7seg-hex.py b/7seg-hex.py index e1bc35b..3bb946a 100644 --- a/7seg-hex.py +++ b/7seg-hex.py @@ -11,22 +11,24 @@ import eeprom_pi as ep ep.init_board() ## Mapping of the I/O 0-7 two the 7-segement display: -## I/O 0: A -## I/O 1: B -## I/O 2: C +## I/O 0: G +## I/O 1: F +## I/O 2: E ## I/O 3: D -## I/O 4: E -## I/O 5: F -## I/O 6: G -SEG_A = 0x1 -SEG_B = 0x2 -SEG_C = 0x4 +## I/O 4: A +## I/O 5: B +## I/O 6: C +SEG_G = 0x1 +SEG_F = 0x2 +SEG_E = 0x4 SEG_D = 0x8 -SEG_E = 0x10 -SEG_F = 0x20 -SEG_G = 0x40 +SEG_A = 0x10 +SEG_B = 0x20 +SEG_C = 0x40 -ep.write_data_at(0x0, SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F) +# do not show anything on 0 +ep.write_data_at(0x0, 0x0) +#ep.write_data_at(0x0, SEG_A | SEG_B | SEG_C | SEG_D | SEG_E | SEG_F) ep.write_data_at(0x1, SEG_B | SEG_C) ep.write_data_at(0x2, SEG_A | SEG_B | SEG_G | SEG_E | SEG_D) ep.write_data_at(0x3, SEG_A | SEG_B | SEG_G | SEG_C | SEG_D) @@ -43,4 +45,6 @@ ep.write_data_at(0xd, SEG_B | SEG_C | SEG_D | SEG_E | SEG_G) ep.write_data_at(0xe, SEG_A | SEG_D | SEG_G | SEG_F | SEG_E) ep.write_data_at(0xf, SEG_A | SEG_E | SEG_F | SEG_G) +raw_input("please unplug the power from the EEPROM and press any key to continue") + ep. cleanup() -- cgit v1.2.3-70-g09d2