forked from KitronikLtd/pxt-kitronik-move-motor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.ts
23 lines (23 loc) · 834 Bytes
/
test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
input.onButtonPressed(Button.AB, function () {
Kitronik_Move_Motor.beepHorn()
})
input.onButtonPressed(Button.B, function () {
basic.showNumber(Kitronik_Move_Motor.measure())
})
input.onButtonPressed(Button.A, function () {
Kitronik_Move_Motor.move(Kitronik_Move_Motor.DriveDirections.Forward, 50)
basic.pause(200)
Kitronik_Move_Motor.spin(Kitronik_Move_Motor.SpinDirections.Left, 35)
basic.pause(200)
Kitronik_Move_Motor.move(Kitronik_Move_Motor.DriveDirections.Reverse, 50)
basic.pause(200)
Kitronik_Move_Motor.spin(Kitronik_Move_Motor.SpinDirections.Right, 35)
basic.pause(200)
Kitronik_Move_Motor.stop()
})
let moveMotorZIP = Kitronik_Move_Motor.createMoveMotorZIPLED(4)
moveMotorZIP.showRainbow(1, 360)
basic.forever(function () {
moveMotorZIP.rotate(1)
moveMotorZIP.show()
})