Wenn jemand den Probot128 hat, funktioniert dieser Skript so?:
Code:
Dim Klapp As Byte 'Counter variable
Dim countdelay As Byte
Sub main() 'Main Programm
PRO_BOT128_INIT() 'PRO-BOT128 System setup
DRIVE_INIT() 'Drive setup
ENC_LED_ON() 'Encoder LEDs "ON"
Klapp = 0 'Counter Var set To zero
BEEP(250,150) 'Play Sound
BEEP(100,150) 'Play Sound
AbsDelay(500)
Do While True 'Endless Loop
If SOUND_LEVEL() > 700 Then 'Sound level larger Then value 700 increment Var Klapp +1
Klapp = Klapp + 1
AbsDelay(100) 'Wait 100ms
End If
Select Case Klapp 'Select Variable count
Case 1 'Varibale Klapp is 1 Then LEDs "ON"
Beepyfor()
Case >=2 'Variable Klapp is 2 Or bigger = "Robo-Dance"
Beepy2()
End Select
End While
End Sub
Sub Beepyfor() 'All Status LEDs "ON"
FLL_ON()
AbsDelay(1000)
FLR_ON()
AbsDelay(1000)
BLL_ON()
AbsDelay(1000)
BLR_ON()
AbsDelay(1000)
Beepy()
End Sub
Sub Beepy()
BEEP(250,150)
BEEP(150,150)
BEEP(350,150)
BEEP(450,150)
BEEP(350,150)
BEEP(450,150)
BEEP(350,150)
BEEP(250,150)
BEEP(550,150)
BEEP(150,150)
AbsDelay(1000)
Beepy2()
End Sub
Sub Beepy2() 'Robo-Dance
BEEP(150,150) 'G
BEEP(300,150) 'C
BEEP(350,150) 'D
BEEP(400,150) 'E
BEEP(300,150) 'C
BEEP(200,150) 'A
BEEP(300,150) 'C
BEEP(150,150) 'G
BEEP(150,150) 'G
BEEP(200,150) 'A
BEEP(300,150) 'C
BEEP(350,150) 'D
BEEP(250,150) 'H
BEEP(300,150) 'C
Endy()
End Sub
Sub Endy()
DRIVE_INIT()
DRIVE_ON()
MOTOR_DIR(1,1)
MOTOR_POWER(220,220)
AbsDelay(2000)
DRIVE_OFF()
MOTOR_STOP()
End Sub
Lesezeichen