Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
PRIVATE SUB Positions() // select which switches are "IN PLay"
FOR x = 0 TO 5 ignore this for now
IF pos1=0 THEN Player1=true play1=1 DELAYMS(1000) TOGGLE(play1) Switch(T)=index +1 END IF//switch(z) is used as a counter pos? is the switch LOW = enabled
IF pos1=1 THEN Player1=false END IF
IF pos2=0 THEN Player2=true play2=1 DELAYMS(1000) TOGGLE(play2) Switch(T)=index +1 END IF //the FOR NEXT LOOP is used to mark which player position
IF pos2=1 THEN Player2=false END IF
IF pos3=0 THEN Player3=true play3=1 DELAYMS(1000) TOGGLE(play3) Switch(T)=index +1 END IF
IF pos3=1 THEN Player3=false END IF
IF pos4=0 THEN Player4=true play4=1 DELAYMS(1000) TOGGLE(play4) Switch(T)=index +1 END IF
IF pos4=1 THEN Player4=false END IF
IF pos5=0 THEN Player5=true play5=1 DELAYMS(1000) TOGGLE(play5) Switch(T)=index +1 END IF
IF pos5=1 THEN Player5=false END IF
IF pos6=0 THEN Player6=true play6=1 DELAYMS(1000) TOGGLE(play6) Switch(T)=index +1 END IF
IF pos6=1 THEN Player6=false END IF
if pos7=0 THEN Player7=true play7=1 DELAYMS(1000) TOGGLE(play7) Switch(T)=index +1 END IF
IF pos7=1 THEN Player7=false END IF
IF pos8 = 0 THEN play8=1 delayms(3000) toggle (Play8) delayms(500)EXIT END IF //exit su route after all players have depressed their button
NEXT
You're plenty smart enough, Burt. At least you know where the boat is.I'm not the smartest guy in the boat
sub Positions() // select which switches are "IN PLay"
// set all players false until they press their button
Player1=false
Player2=false
Player3=false
Player4=false
Player5=false
Player6=false
Player7=false
// whatever this is supposed to do, it was done for any switch press
// so might as well just do it here. it likely doesn't work anyway
Switch(T)=index +1
// stay in this loop until switch 8 = 0
while (pos8 = 1)
IF pos1=0 THEN
Player1=true
play1=1 // turn on led (assuming it's an output)
DELAYMS(1000)
play1=0
END IF
IF pos2=0 THEN
Player2=true
play2=1
DELAYMS(1000)
play2=0
END IF
IF pos3=0 THEN
Player3=true
play3=1
DELAYMS(1000)
play3=0
END IF
IF pos4=0 THEN
Player4=true
play4=1
DELAYMS(1000)
play4=0
END IF
IF pos5=0 THEN
Player5=true
play5=1
DELAYMS(1000)
play5=0
END IF
IF pos6=0 THEN
Player6=true
play6=1
DELAYMS(1000)
play6=0
END IF
if pos7=0 THEN
Player7=true
play7=1
DELAYMS(1000)
play7=0
END IF
end while
// signal that we saw switch 8 low and we're exiting
play8=1
delayms(3000)
play8=0
delayms(500)
end sub
IF Player1 = true
THEN led1 = 1
end if
if switch1=0 then led1 = 0 if the switch1 = 0 then code to jump to next TRUE statement and turn off the led1
exit
DELAYMS(et_time)
TOGGLE (led1)
END IF
IF Player2 = true
THEN led2 = 1
DELAYMS(et_time)
TOGGLE (led2)
END IF
IF Player3 = true
THEN led3 = 1
DELAYMS(et_time)
TOGGLE (led3)
END IF
but trying to exit an IF THEN statement...
You'll have to do a better job of describing how you want this to work. Use English. Don't use code to try and describe it since your coding is part of the problem.my objective is progress through a series of IF THEN statements and if the switch() is pressed then the code progress to the next IF THEN