Timer issue.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mg64775@gmail.com
New user
Posts: 3
Joined: 22 Jan 2020, 19:30
Location: florida us

Timer issue.

#1 Post by mg64775@gmail.com » 31 Jan 2020, 01:42

I need to repeat an event every second and flip-flop a GPIO pin, this does NOT work, what is wrong?
on system#boot do
timerset,1,1
let,1,1
enddo

on rules#timer=1 do
if %v1% = 1
oled,1,1,"ha"
gpio,0,0
let,1,2
timerset,1,2
else
oled,1,1,"hi"
gpio,0,1
let,1,1
timerset,1,2
endif
enddo

User avatar
ThomasB
Normal user
Posts: 1065
Joined: 17 Jun 2018, 20:41
Location: USA

Re: Timer issue.

#2 Post by ThomasB » 31 Jan 2020, 02:02

I see a typo in two places. Replace enddo with endon at both locations.

- Thomas

mg64775@gmail.com
New user
Posts: 3
Joined: 22 Jan 2020, 19:30
Location: florida us

Re: Timer issue.

#3 Post by mg64775@gmail.com » 01 Feb 2020, 15:53

thanks so much, learning curve is quite steep and it was quite a silly mistake.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 35 guests