-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtests.ts
More file actions
59 lines (47 loc) · 1.42 KB
/
tests.ts
File metadata and controls
59 lines (47 loc) · 1.42 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
// Read Joystick X axis
basic.showNumber(bitcommander.readJoystick(BCJoystick.X));
basic.pause(100);
// Read Joystick Y axis
basic.showNumber(bitcommander.readJoystick(BCJoystick.Y));
basic.pause(100);
// Read Dial
basic.showNumber(bitcommander.readDial());
basic.pause(100);
// Show states of all buttons
basic.showNumber(bitcommander.readButton(BCButtons.Red));
basic.showNumber(bitcommander.readButton(BCButtons.Yellow));
basic.showNumber(bitcommander.readButton(BCButtons.Green));
basic.showNumber(bitcommander.readButton(BCButtons.Blue));
basic.showNumber(bitcommander.readButton(BCButtons.Joystick));
basic.pause(100);
// Play tune on Speaker
music.playTone(262, music.beat(BeatFraction.Whole));
basic.pause(100);
// Show all leds
bitbot.neoSetColor(neopixel.colors(NeoPixelColors.Red));
bitbot.neoShow();
// Clear all leds
bitbot.neoClear();
bitbot.neoShow();
// Show led at position 0
bitbot.neoSetPixelColor(0, neopixel.colors(NeoPixelColors.Red));
bitbot.neoShow();
// Show led rainbow
bitbot.neoRainbow();
bitbot.neoShow();
// Show led rainbow and shift
bitbot.neoRainbow();
bitbot.neoShift();
bitbot.neoShow();
// Show led rainbow and rotate
bitbot.neoRainbow();
bitbot.neoRotate();
bitbot.neoShow();
// Set brightness of leds
bitbot.neoBrightness(100);
bitbot.neoShow();
// Use neo() variable
bitbot.neo().clear();
bitbot.neo().show();
}