How to write ''WRITE''?
Archiver
Posts: 46,084
>Log_Data:
>GOSUB ReadRTCBurst
>=Write Location, [noparse][[/noparse]Seconds,Minutes,Hours,Date,Month,Day,Year]
>=Write¡K
>GOTO Recheck
You need to use a for-next loop to write each group of 8 bytes. The
following assumes that the bytes are in memory in order from
seconds..year. That allows the program to address the 8 bytes as an
array. I'm not sure what you mean by writeiK
for i=0 to 6
write location+i,seconds(i)
write location+7,iK
next
location=location+8 ' start of next record
The value of variable "location" will be rezeroed when your Stamp is
reset. So you may need to store that value in eeprom or in your
clock RAM (if it has some) each time you log data, or you could tag
the data file itself so that you can scan for the next "free" record
during program initialization.
-- Tracy
>GOSUB ReadRTCBurst
>=Write Location, [noparse][[/noparse]Seconds,Minutes,Hours,Date,Month,Day,Year]
>=Write¡K
>GOTO Recheck
You need to use a for-next loop to write each group of 8 bytes. The
following assumes that the bytes are in memory in order from
seconds..year. That allows the program to address the 8 bytes as an
array. I'm not sure what you mean by writeiK
for i=0 to 6
write location+i,seconds(i)
write location+7,iK
next
location=location+8 ' start of next record
The value of variable "location" will be rezeroed when your Stamp is
reset. So you may need to store that value in eeprom or in your
clock RAM (if it has some) each time you log data, or you could tag
the data file itself so that you can scan for the next "free" record
during program initialization.
-- Tracy