oh sorry for that, my fault there. Was at work an in a rush to get out an no copy of code on me.
So start0: falls into a testit: loop and start1: just ends would fall into start2: and stop didn't seem to work it also stopped start0:. Any help would be gratefully appreciated.
(code)
start0:
for b15=1 to 60 ;Delay for PIR
pause 1000
next b15
serout TENDA,4800,($EF) ;STOP MP3
pause 500
serout TENDA,4800,($E7) ;Set MP3 Volume
pause 500
testit:
Do : loop until PIR_IN=1
Do
PIR_COUNT = PIR_COUNT + 1 * PIR_IN
loop until PIR_COUNT = 10
PIR_COUNT = 0
goto turn1
Start1:
pause 500
MovementType = 0 ;reset movement type index to first data block
LastCommand=$ff ;show no last command
Random_Word=RandomSeed ;start random number off with random seed
ReadPointer=MovementType+HeadTurnData+HeadCenter
Read ReadPointer,Temp_LSB ;get default position for servo
servo HeadTurnServo,Temp_LSB ;and setup servo with it
TurnPos=Temp_LSB ;and the software too
ReadPointer=MovementType+HeadNodData+HeadCenter
Read ReadPointer,Temp_LSB ;get default position for servo
servo HeadNodServo,Temp_LSB ;and setup servo with it
NodPos_MSB=Temp_LSB ;and the software too
NodPos_LSB=128 ;make it x.5 for round off
ReadPointer=MovementType+HeadTiltData+HeadCenter
read ReadPointer,Temp_LSB ;get default position for servo
servo HeadTiltServo,Temp_LSB ;and setup servo with it
TiltPos_MSB=Temp_LSB ;and the software too
TiltPos_LSB=128 ;make it x.5 for round off
stop
start2:
pause 2000
MovementType=0 ;yes, set the index to start of table
high EyesOutput ;and set Eyes output
Temp_LSB=7 ;and do all 7 movement types
goto main
turn1:
suspend 2
pause 500
serout TENDA,4800, (01) 'Play MP3
pause 500
servo B.2,210 'turn head
servopos B.2,210
for b16=1 to 5 'delay for mp3
pause 1000
next b16
servopos B.2,130 'turn head
pause 500
resume 2
for time = 1 to 150
pause 2000
next time
goto testit
main:
Random Random_Word ;get next random number
Temp_LSB=Random_MSB * Temp_LSB /256; ;get a random from 0 to 4 or 0 to 6
if LastCommand = Temp_LSB then start2 ;get another command if repeating the last one.
On Temp_LSB gosub LookHome,LookFarLeft,LookNearLeft,LookFarRight,LookNearRight,LookAt,NodNo
Goto start2