blob: a7440cfacad02317f23a46b098b48473ee04cfdd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
## This file write different programms to the EEPROM AT28C
## programm start at 0x00
import test_prog
import fibonacci_prog
import eeprom_pi as ep
import sys
prog = None
if len(sys.argv) == 2:
if sys.argv[1] == "test":
prog = test_prog.prog
if prog == None:
print("error: please specify a valid programm.")
print("valid programms are: test")
exit()
## start at addres 0x0
address = 0x0
inst_nr = 0
ep.init_board()
for instruction in prog:
print("%s: %s" % (hex(address+inst_nr), hex(instruction)))
ep.write_data_at(address+inst_nr, instruction)
inst_nr += 1
trash = raw_input("please unplug the power from the EEPORM and press any key to continue")
ep.cleanup()
|