Counting pushbutton
Hi I'm trying to create a counter in order to change the pin in which I am sending my clock pulses to a different sensor every time I push a button.
My issue is that I am getting an error that symbol is already defined and my first if function is highlighted.
this what I have in a subroutine:
I learned to make a counter in C, but it seems to have to be done differently in basic stamp.
My issue is that I am getting an error that symbol is already defined and my first if function is highlighted.
this what I have in a subroutine:
Clockcounter:
IF (senscnt > 5) THEN
senscnt=0
NEXT
IF PIN 17 = HIGH THEN
senscnt=snscnt+1
NEXT ,
IF (senscnt = 0) THEN
clock PIN 2
NEXT
IF (senscnt = 1) THEN
PIN 2 = 0,
clock PIN 3
NEXT
IF (senscnt = 2) THEN
PIN 3=0,
clock PIN 4
NEXT
IF (senscnt = 3) THEN
pin4=0 ,
clock PIN 5
NEXT
IF (senscnt = 4) THEN
pin5=0 ,
clock PIN 6
NEXT
IF (senscnt = 5) THEN
PIN 6=0,
clock PIN 9
RETURN
I learned to make a counter in C, but it seems to have to be done differently in basic stamp.