Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Real Time ClockEpoch is 1.1.1970 (Unix time stamp). But valid dates are from 1.1.2000 to 31.12.2099 because of the STM32WB RTC peripheral. | ||||||||
Changed: | ||||||||
< < | time! ( -- u ) Returns the unix time stamp. time@ ( u -- ) Sets the real time clock. | |||||||
> > | time@ ( -- u ) Returns the unix time stamp. time! ( u -- ) Sets the real time clock. | |||||||
.time ( -- ) Prints the current date and time (YYYY-MM-DDTHH:MM:SS ISO 8601). | ||||||||
Changed: | ||||||||
< < | date | |||||||
> > | date Prints date unix style Mon Jan 1 01:57:52 2000 wait-alarm ( -- ) Wait for an alarm alarm! (h m s -- ) Sets the alarm, invalid parameters e.g. -1 mask the parameter | |||||||
Added: | ||||||||
> > | ||||||||
How to set the current date and time?Copy the current time stamp from a Unix machine (GNU/Linux box) or from https://www.unixtimestamp.com/![]() | ||||||||
Line: 29 to 33 | ||||||||
Sun Oct 11 15:36:02 2020 | ||||||||
Added: | ||||||||
> > |
Set AlarmsWake me at 06:006 0 0 alarm! wait-alarm .( Get Up!)[RET] Get Up! ok.If you want an alarm every second: -1 -1 -1 alarm![RET] ok.for every minute: -1 -1 0 alarm![RET] ok.Stop the alarms: 0 0 0 alarm![RET] ok. : count-down ( -- ) -1 -1 -1 alarm! \ an alarm every second 10 0 do cr 10 i - . wait-alarm loop cr ." 0 Launch!" ; count-down[RET] 10 9 8 7 6 5 4 3 2 1 0 Launch! ok. | |||||||
-- ![]() Comments |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Real Time ClockEpoch is 1.1.1970 (Unix time stamp). But valid dates are from 1.1.2000 to 31.12.2099 because of the STM32WB RTC peripheral.time! ( -- u ) Returns the unix time stamp. time@ ( u -- ) Sets the real time clock. .time ( -- ) Prints the current date and time (YYYY-MM-DDTHH:MM:SS ISO 8601). date How to set the current date and time?Copy the current time stamp from a Unix machine (GNU/Linux box) or from https://www.unixtimestamp.com/![]() $ date +%s 1602430522Paste the time stamp in the Mecrisp-Cube console: ok. 1602430522 time![RET] ok. .time[RET] 2020-10-11T15:35:27 ok. date[RET] Sun Oct 11 15:36:02 2020-- ![]() Comments |