I think you are wasting
I think you are wasting space
As I read your code, you are doing “Bitmap”, when you could be doing “Vectors”, explanation (not scientific, but to try to explain):
- A line of 100 pixels drawn on a bitmap picture would take 100 bits.
- Drawn as vectors, it would take the info “start point - draw line - end point”
If you are programming it like this:
For variable = 0 to eeprom’s end
Read input -> put that into eeprom
next variable
- you will be filling up your space with lots of nothing’s, no changes; Even if there is no (new) data t record, you will still be sampling, filling up the memory.
However, if you do it like this:
readadc, b0
do:
readadc, b1
gosub pauseroutine
w3 = w3 +1 ’ this is the “timer” (how long before next change)
if b1 <> b0 then ’ only store data when there is change in data
b0 = b1
b2 = b2 +1
write data to eeprom at address value of b2: b1(the value), w3(how long time before this value occurs)
w3 = 0
end if
loop while b2 < eeprom max register
pauseroutine:
do the rest of the program, what ever is needed to be done, and if nothing, make perhaps a straight “pause 25”. The time it takes to do this should be the same when you play back afterwards, and by entering a “pause” command, you can ajust, and perhaps only make it “pause 19” when playing back, to get the same speed, if the rest of your program takes longer to execute when playng back. You can also use the “timer” functions / interrupt…
return
(This code is pseudo very much, however, 100% of the structure and perhaps 75% of the actual code is useable)
- Then you will have a double set of variables in your eeprom; Where did the change occour (w3), and what value did it have (b1). When playing back you can then make it like this
b2 = 0
Mainplay:
read “w3” from eeprom
read “b1” from eeprom
do:
gosub pauseroutine
w4 = w4 +1
loop while w4 <= w3
b2 = b2 +1
do what you have to do with the data from b1 (now is the time)
w4 = 0
as long as b2 < eeprom max register, goto mainplay
pauseroutine:
do the rest of the program, what ever is needed to be done, and if nothing, make perhaps a straight “pause 25”. The time it takes to do this should be the same when you play back afterwards, and by entering a “pause” command, you can ajust, and perhaps only make it “pause 19” when playing back, to get the same speed, if the rest of your program takes longer to execute when playng back. You can also use the “timer” functions / interrupt…
return
This way you will be able to only store the canges, and play them back at the same speed