1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#MASTER
DEFINE BT_CONN=1
def sub_BTCheck(conn):
if (BluetoothStatus(conn)!=NO_ERR):
TextOut(5,LCD_LINE2,"Error")
Wait(1000)
Stop(True)
DEFINE('MOTOR(p,s)',"""RemoteSetOutputState(BT_CONN, p, s, \\
OUT_MODE_MOTORON+OUT_MODE_BRAKE+OUT_MODE_REGULATED, \\
OUT_REGMODE_SPEED, 0, OUT_RUNSTATE_RUNNING, 0)""")
def main():
sub_BTCheck(BT_CONN)
RemotePlayTone(BT_CONN, 4000, 100)
while (BluetoothStatus(BT_CONN)!=NO_ERR):
pass
Wait(110)
RemotePlaySoundFile(BT_CONN, "! Click.rso", false)
while (BluetoothStatus(BT_CONN)!=NO_ERR):
pass
#Wait(500)
RemoteResetMotorPosition(BT_CONN,OUT_A,true)
while (BluetoothStatus(BT_CONN)!=NO_ERR):
pass
MOTOR(OUT_A,100)
Wait(1000)
MOTOR(OUT_A,0)
|