P
pmolsen
I am using an Excel spreadsheet to record the steps to be used by a PI
to turn on/off strings of lights in a Christmas lights display (4
outputs). Each column represents one output string of lights and eac
row corresponds to a time of 100mS. Each cell contains just 0 or 1 fo
off or on. I am doing it in Excel to make it easy to shift individua
columns of bits up and down or to duplicate bits etc.
I then need to convert the data to a format that I can use to downloa
into an I2C EEPROM chip using Picaxe Basic. Is it possible to write
macro to do that? What I envisage is a macro that reformats the dat
and writes it to a new sheet in the current spreadsheet containing
single column. I can then just cut that column and paste to Notepad an
save it.
The data contains a column header row that says what each colum
contains and then each row is the list of 0 or 1 values in eac
column:
eg.
Elf1 Elf2 Santa Rudolph Tree1 Tree2 Porch Angel1 Angel2..... (4
columns)
0 0 1 0 1 0 1 0 1 0 1 0
1 1 1......
1 1 0 1 1 0 1 0 1 1 1 0
0 1 0.....
What I have to produce from that is the following code:
(ie. ignore the header line then combine the 48 columns in each ro
into 6 byte values as follows)
writei2
w1,(%00101010,%10101110,%10101010,%10101010,%10101010,%10101010)
gosub nextpos
writei2
w1,(%11011010,%11100100,%01011111,%01010101,%01010101,%01010100)
gosub nextpos
...et
to turn on/off strings of lights in a Christmas lights display (4
outputs). Each column represents one output string of lights and eac
row corresponds to a time of 100mS. Each cell contains just 0 or 1 fo
off or on. I am doing it in Excel to make it easy to shift individua
columns of bits up and down or to duplicate bits etc.
I then need to convert the data to a format that I can use to downloa
into an I2C EEPROM chip using Picaxe Basic. Is it possible to write
macro to do that? What I envisage is a macro that reformats the dat
and writes it to a new sheet in the current spreadsheet containing
single column. I can then just cut that column and paste to Notepad an
save it.
The data contains a column header row that says what each colum
contains and then each row is the list of 0 or 1 values in eac
column:
eg.
Elf1 Elf2 Santa Rudolph Tree1 Tree2 Porch Angel1 Angel2..... (4
columns)
0 0 1 0 1 0 1 0 1 0 1 0
1 1 1......
1 1 0 1 1 0 1 0 1 1 1 0
0 1 0.....
What I have to produce from that is the following code:
(ie. ignore the header line then combine the 48 columns in each ro
into 6 byte values as follows)
writei2
w1,(%00101010,%10101110,%10101010,%10101010,%10101010,%10101010)
gosub nextpos
writei2
w1,(%11011010,%11100100,%01011111,%01010101,%01010101,%01010100)
gosub nextpos
...et