Ontimer1.txt

Warning: if you clip this code into your program, look out for possible html code slipping in.

REM
REM ON TIMER EXAMPLE -- invert a variable every 5 seconds
REM

GLOBAL elapsed_time AS INTEGER, flipflop AS INTEGER, last_flipflop as INTEGER

VITAL SUBROUTINE timer_handler( timer_number AS INTEGER )
	
SET TIMER0 TO 500
flipflop=-flipflop

END

REM Start MAIN Example

ON TIMER0 timer_handler
SET TIMER0 to 10
flipflop = 1:last_flipflop=flipflop
DO WHILE 1
	IF flipflop<>last_flipflop	
		print "\010\0135 seconds has elapsed"
		last_flipflop=flipflop
	ENDIF
LOOP