will this code work?
Q2-to repeat a code what value do i have to give for the FOR loop i have assumed it to be 0 to 0
THE CODE---------
main: if pinc.4 = 1 then main2
if pinc.0 = 1 then main3
if pinc.1 = 1 then main4
goto main
main2:for b0 = 0 to 0
play 2,0
next b0
pause 2000
goto main
main3:for b0 = 0 to 0
play 2,1
next b0
pause 2000
goto main
main4:for b0 = 0 to 0
play 2,3
next b0
pause 2000
goto main
7
answers
|
Answer it!
|
Your code runs and I can get it to play all 3 tunes so in that respect I guess it works. (simulated)
As for Q2 you don't need the for next as the tune will play a single run through once it is started automatically.
main: irin [1000,main],C.3,b0
if b0=0 then main2
if b0=1 then main3
if b0=2 then main4
if pinc.4 = 1 then main2
if pinc.0 = 1 then main3
if pinc.1 = 1 then main4
goto main
main2:for b0 = 0 to 0
play 2,0
next b0
pause 2000
goto main
main3:for b0 = 0 to 0
play 2,1
next b0
pause 2000
goto main
main4:for b0 = 0 to 0
play 2,3
next b0
pause 2000
goto main
Once it is playing it will continue until the tune is finished without you doing anything.
Is that what you want it to do.
![]() |






























