aboutsummaryrefslogtreecommitdiff
path: root/7seg-hex.py
diff options
context:
space:
mode:
Diffstat (limited to '7seg-hex.py')
-rw-r--r--7seg-hex.py30
1 files changed, 17 insertions, 13 deletions
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()