-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathtest.ts
37 lines (37 loc) · 1.67 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// tests go here; this will not be compiled when this package is used as a library
motorbit.Setting_the_on_board_lights(Offset.ONE, RgbColors.Red)
motorbit.Setting_the_on_board_lights(Offset.TWO, RgbColors.Red)
motorbit.Setting_the_on_board_lights(Offset.THREE, RgbColors.Red)
motorbit.Setting_the_on_board_lights(Offset.FOUR, RgbColors.Red)
basic.pause(100)
motorbit.Setting_the_on_board_lights(Offset.ONE, RgbColors.Green)
motorbit.Setting_the_on_board_lights(Offset.TWO, RgbColors.Green)
motorbit.Setting_the_on_board_lights(Offset.THREE, RgbColors.Green)
motorbit.Setting_the_on_board_lights(Offset.FOUR, RgbColors.Green)
basic.pause(100)
motorbit.Setting_the_on_board_lights(Offset.ONE, RgbColors.Blue)
motorbit.Setting_the_on_board_lights(Offset.TWO, RgbColors.Blue)
motorbit.Setting_the_on_board_lights(Offset.THREE, RgbColors.Blue)
motorbit.Setting_the_on_board_lights(Offset.FOUR, RgbColors.Blue)
basic.pause(100)
motorbit.close_all_the_on_board_lights()
music.playTone(262, music.beat(BeatFraction.Whole))
basic.pause(100)
music.stopAllSounds()
basic.forever(function () {
motorbit.MotorRun(motorbit.Motors.M1, 255)
motorbit.MotorRun(motorbit.Motors.M2, 255)
motorbit.MotorRun(motorbit.Motors.M3, 255)
motorbit.MotorRun(motorbit.Motors.M4, 255)
basic.pause(1000)
motorbit.MotorRun(motorbit.Motors.M1, -255)
motorbit.MotorRun(motorbit.Motors.M2, -255)
motorbit.MotorRun(motorbit.Motors.M3, -255)
motorbit.MotorRun(motorbit.Motors.M4, -255)
basic.pause(1000)
motorbit.MotorRun(motorbit.Motors.M1, 0)
motorbit.MotorRun(motorbit.Motors.M2, 0)
motorbit.MotorRun(motorbit.Motors.M3, 0)
motorbit.MotorRun(motorbit.Motors.M4, 0)
basic.pause(1000)
})