Reset TIME variable?

geezer88

Senior Member
I've spent an hour reading the manual and searching the posts to no avail. But this must be a question that has come up before:

How can I reset the TIME variable to zero in a running program? Enabletime and Disabletime just seem to start it and stop it, but don't reset it to zero. I guess I can poke zero into the proper timer register, but I was hoping there was a simpler way that wouldn't require so much research.

By the way, I'm a newby, and I think these PicAxe micros are great.

thanks,
tom
 

westaust55

Moderator
Welcome to the PICAXE forum

have you tried
time = 0​

time is just a pre defined variable and can be treated as a variable in terms of using the value or assigning a value to it.

Have a read of PICAXE manual 2 page 13. Presumtoion is you have an 18M2 (helps to give as much informaiton as possible)
 
Last edited:

tarzan

Senior Member
picaxe18m2.pdf

Time Variable
The new word variable ‘Time’ increments after every second the program has been running.
It can count up to 65535 elapsed seconds (approx 18 hours) before overflowing.
To reset simply use ‘let time = 0’.
See: disabletime, enabletime
 
Last edited:

geezer88

Senior Member
Wow, you folks are fast. Too bad this old goat isn't. Yes, TIME = 0 works like a charm.

Thanks for the sudden service!

tom
 

westaust55

Moderator
Helps get answers when there is an international audience.
Someone is one line almost every second of the day somewhere
 
Top