BS2 and StampDock - how to use the gettime command?
IceFirePro
Posts: 86
Hi, reading the help does not work at all. Can someone help me with a sample bit of code?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Post Edited (Franklin) : 6/11/2010 2:52:34 PM GMT
x VAR Byte
DEBUG "?t0;"
SERIN 16, 16486, [noparse][[/noparse]X]
PAUSE 2
DEBUG DEC x
The result is not the time, but unrecognizable characters.
Post Edited (hover1) : 6/11/2010 8:32:03 PM GMT
I kind of missed this forum thread, just saw it for the first time.
First, there was a small bug in the previous StampDock version .. as time in mode 1 gave
the same result as time in mode 0.
It's fixed in the last version you can download at http://apsdev.com/stampdock/
Also i has some nice new features.
Like it now has serial receive and transmit indicators.
It has round knobs you can turn around in the GUI and use as input and output.
You can now have multiple graphics objects, and there are more commands to do
operations on a whole graphics object, like scroll in any direction, flip it around its
axis, invert it .. make it lighter or darker etc.
Also you can have multiple video objects, and they have more options.
Now you can also load pictures like JPG, PNG, GIF etc in the video object,
they will be scaled to the size of the video object and there 8 different fade
methodes so the previous picture will fade into the next.
You can now send data in binairy mode to the stamp.
And if commands require large pieces of text, you can replace them by a number
and put the text in a "phrasebook" file on the host system.
So you can fit more code in the basic stamp memory.
This is the piece of code i used to test time in mode 1:
y2 VAR Byte
y1 VAR Byte
m VAR Byte
d VAR Byte
h VAR Byte
mi VAR Byte
s VAR Byte
t VAR Byte
DEBUG "?t1;" ' returns 8 bytes with the time
SERIN 16, 16468, [noparse][[/noparse]y2] ' 9600 baud for BS2 , BS2e and BS2pe
SERIN 16, 16468, [noparse][[/noparse]y1] ' 9600 baud for BS2 , BS2e and BS2pe
SERIN 16, 16468, [noparse][[/noparse]m] ' 9600 baud for BS2 , BS2e and BS2pe
SERIN 16, 16468, [noparse][[/noparse]d] ' 9600 baud for BS2 , BS2e and BS2pe
SERIN 16, 16468, [noparse][[/noparse]h] ' 9600 baud for BS2 , BS2e and BS2pe
SERIN 16, 16468, [noparse][[/noparse]mi] ' 9600 baud for BS2 , BS2e and BS2pe
SERIN 16, 16468, ' 9600 baud for BS2 , BS2e and BS2pe
SERIN 16, 16468, [noparse][[/noparse]t] ' 9600 baud for BS2 , BS2e and BS2pe
PAUSE 2 ' millisecs
DEBUG " date month " , DEC m, " day ", DEC d, "hour ", DEC h, " minute", DEC mi," secs", DEC s, " ticks ", DEC t, " <- " , CR
DEBUG " time hour ", DEC h, " minute ", DEC mi," secs", DEC s, " ticks", DEC t, " <- " , CR
DEBUG "Year ", DEC y2 * 256 + y1 , " <- "