|
Revision 280, 0.6 KB
(checked in by atorf, 5 years ago)
|
|
Added new Sensor demos and motor tests
|
| Line | |
|---|
| 1 | COM_CloseNXT all |
|---|
| 2 | |
|---|
| 3 | clear |
|---|
| 4 | |
|---|
| 5 | h = COM_OpenNXT('bluetooth.ini', 'check'); |
|---|
| 6 | COM_SetDefaultNXT(h); |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | port1 = MOTOR_B; |
|---|
| 10 | port2 = MOTOR_C; |
|---|
| 11 | |
|---|
| 12 | power = 60; |
|---|
| 13 | limit = 5000; |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | StopMotor all off |
|---|
| 17 | NXT_ResetMotorPosition(port1, false); |
|---|
| 18 | NXT_ResetMotorPosition(port1, true); |
|---|
| 19 | NXT_ResetMotorPosition(port2, false); |
|---|
| 20 | NXT_ResetMotorPosition(port2, true); |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | SetMotor(port1) |
|---|
| 25 | SyncToMotor(port2) |
|---|
| 26 | SetPower(power) |
|---|
| 27 | SetAngleLimit(limit) |
|---|
| 28 | SendMotorSettings |
|---|
| 29 | |
|---|
| 30 | WaitForMotor(port1) |
|---|
| 31 | |
|---|
| 32 | pause(2) |
|---|
| 33 | |
|---|
| 34 | SetMotor(port1) |
|---|
| 35 | SyncToMotor(port2) |
|---|
| 36 | SetPower(-power) |
|---|
| 37 | SetAngleLimit(limit) |
|---|
| 38 | SendMotorSettings |
|---|
| 39 | |
|---|
| 40 | WaitForMotor(port1) |
|---|
| 41 | |
|---|
| 42 | pause(2) |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | StopMotor all off |
|---|