-
Notifications
You must be signed in to change notification settings - Fork 2
/
catears_11_microbit.js
38 lines (38 loc) · 2.14 KB
/
catears_11_microbit.js
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
38
input.onButtonPressed(Button.AB, function () {
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo1, 60)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo2, 80)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo3, 60)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo4, 80)
basic.pause(800)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo1, 60)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo2, 0)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo3, 120)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo4, 80)
basic.pause(1000)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo1, 60)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo2, 80)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo3, 60)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo4, 80)
basic.pause(500)
})
input.onButtonPressed(Button.B, function () {
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo1, 60)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo2, 80)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo1, 0)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo2, 120)
basic.pause(1000)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo1, 60)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo2, 80)
basic.pause(500)
})
input.onButtonPressed(Button.A, function () {
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo3, 60)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo4, 80)
basic.pause(800)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo3, 0)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo4, 180)
basic.pause(1000)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo3, 60)
kitronik_i2c_16_servo.servoWrite(kitronik_i2c_16_servo.Servos.Servo4, 80)
basic.pause(500)
})