Tweaking Jon W.'s code
ERM
Posts: 34
Hi guys (and gals),
I am trying to reapply Jon Williams' sequencer.bs2 code where he has entered data into the EEPROM data section. That data looks like this:
'
[noparse][[/noparse] EEPROM Data ]
RecLen CON 3 ' 3 bytes per record
ZigZag DATA Word %0000000010000000, 2
DATA Word %0000000101000000, 2
DATA Word %0000001000100000, 2
DATA Word %0000010000010000, 2
DATA Word %0000100000001000, 2
DATA Word %0001000000000100, 2
DATA Word %0010000000000010, 2
DATA Word %0100000000000001, 2
DATA Word %0010000000000010, 2
DATA Word %0001000000000100, 2
DATA Word %0000100000001000, 2
DATA Word %0000010000010000, 2
DATA Word %0000001000100000, 2
DATA Word %0000000101000000, 2
DATA Word %0000000010000000, 2
DATA Word %0000000000000000, 0
Now, rearranging this data, can this format be used in single lines of code instead of writing it into the EEPROM. (i.e.
%0100000000000001, 2
Instead of writing:
high 0
pause 200
low 0
I know the above %000...1, 2 code does not work, but can it be rewritten to work to refrain from using the latter code saving space?
Thanks,
Tony
I am trying to reapply Jon Williams' sequencer.bs2 code where he has entered data into the EEPROM data section. That data looks like this:
'
[noparse][[/noparse] EEPROM Data ]
RecLen CON 3 ' 3 bytes per record
ZigZag DATA Word %0000000010000000, 2
DATA Word %0000000101000000, 2
DATA Word %0000001000100000, 2
DATA Word %0000010000010000, 2
DATA Word %0000100000001000, 2
DATA Word %0001000000000100, 2
DATA Word %0010000000000010, 2
DATA Word %0100000000000001, 2
DATA Word %0010000000000010, 2
DATA Word %0001000000000100, 2
DATA Word %0000100000001000, 2
DATA Word %0000010000010000, 2
DATA Word %0000001000100000, 2
DATA Word %0000000101000000, 2
DATA Word %0000000010000000, 2
DATA Word %0000000000000000, 0
Now, rearranging this data, can this format be used in single lines of code instead of writing it into the EEPROM. (i.e.
%0100000000000001, 2
Instead of writing:
high 0
pause 200
low 0
I know the above %000...1, 2 code does not work, but can it be rewritten to work to refrain from using the latter code saving space?
Thanks,
Tony
Comments
The beauty of this kind of sequencer is that you can adjust the sequence without ever making adjustments to the "engine" itself.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
BUT... That would probably make for a more complex code which takes more EEPROM space and executes slower...
(Not to mention, is much more difficult to read...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax