-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ts
21 lines (20 loc) · 873 Bytes
/
test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
DFRobotMaqueenPlus.I2CInit()
DFRobotMaqueenPlus.mototRun(Motors.ALL, Dir.CW, 100)
basic.pause(1000)
DFRobotMaqueenPlus.mototStop(Motors.ALL)
basic.pause(1000)
DFRobotMaqueenPlus.setRGBLight(RGBLight.RGBL, Color.RED)
basic.pause(1000)
DFRobotMaqueenPlus.setRGBLight(RGBLight.RGBL, Color.YELLOW)
basic.pause(1000)
DFRobotMaqueenPlus.setRGBLight(RGBLight.RGBL, Color.OFF)
basic.pause(1000)
DFRobotMaqueenPlus.servoRun(Servos.S1, 90)
basic.pause(1000)
basic.forever(function () {
serial.writeValue("Speed", DFRobotMaqueenPlus.readSpeed(Motors1.M1))
serial.writeValue("direction", DFRobotMaqueenPlus.readDirection(Motors1.M1))
serial.writeValue("patrol", DFRobotMaqueenPlus.readPatrol(Patrol.L1))
serial.writeValue("ultrasonic", DFRobotMaqueenPlus.ultraSonic(PIN.P0, PIN.P0))
serial.writeValue("voltage", DFRobotMaqueenPlus.readPatrolVoltage(Patrol.L1))
})