Hi everyone,
I wrote a very basic code for a cricket(insect) sound simulator.It works on the sim in prog editor perfectly,but does not work properly on chip.There is nothing wrong with the chip,as i can download other programs to it and works fine.
What i need is a random number of chirps(b6=up to 5 chirps)and random time interval between the chirps(b7=up to 10 secs plus loop to minutes)and random switch to a second cricket sound(cricket1.When downloaded to the chip it just keeps chirping constantly and does not stop. What am i doing wrong? I realize the codes probably a bit clunky!
It's a 28x 4Mhz...Thank you...
cricket: random b6
b6=b6/50
for b4= 0 to b6
for b0 = 1 to 2
for b1 = 1 to 3
sound 0,(125,1)
pause 20
next b1
pause 100
next b0
pause 450
next b4
waiting: random b7
b7=b7/25
w5=b7*1000
low 0
for b3= 1 to 1
pause w5
next b3
if b6=1 then cricket1
random b6
goto cricket
cricket1: for b5=1 to b7
sound 0,(125,3)
pause 5
pause 350
sound 0,(125,3)
pause 5
pause 29
sound 0,(125,3)
pause 5
low 0
wait 3
next b5
random b6
random b7
goto waiting
I wrote a very basic code for a cricket(insect) sound simulator.It works on the sim in prog editor perfectly,but does not work properly on chip.There is nothing wrong with the chip,as i can download other programs to it and works fine.
What i need is a random number of chirps(b6=up to 5 chirps)and random time interval between the chirps(b7=up to 10 secs plus loop to minutes)and random switch to a second cricket sound(cricket1.When downloaded to the chip it just keeps chirping constantly and does not stop. What am i doing wrong? I realize the codes probably a bit clunky!
It's a 28x 4Mhz...Thank you...
cricket: random b6
b6=b6/50
for b4= 0 to b6
for b0 = 1 to 2
for b1 = 1 to 3
sound 0,(125,1)
pause 20
next b1
pause 100
next b0
pause 450
next b4
waiting: random b7
b7=b7/25
w5=b7*1000
low 0
for b3= 1 to 1
pause w5
next b3
if b6=1 then cricket1
random b6
goto cricket
cricket1: for b5=1 to b7
sound 0,(125,3)
pause 5
pause 350
sound 0,(125,3)
pause 5
pause 29
sound 0,(125,3)
pause 5
low 0
wait 3
next b5
random b6
random b7
goto waiting