-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgiggletest.ts
55 lines (47 loc) · 1.53 KB
/
giggletest.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
// Testing the wrapper functions that control the smile
lights.smileCycleRainbowTime(200, 3000)
basic.pause(500)
lights.smileShow(NeoPixelColors.Red)
basic.pause(500)
lights.smileShow(NeoPixelColors.Green)
basic.pause(500)
lights.smileShow(NeoPixelColors.Blue)
basic.pause(500)
lights.smileShow(NeoPixelColors.Black)
basic.pause(500)
lights.smileCycleRainbow(5)
for (let i = 0; i < 7; i++) {
lights.smileShowGraph(i, 7)
basic.pause(200)
}
enum gigglebotWhichEyes {
//% block="both eyes"
Both = 2,
//% block="left eye"
Left = 1,
//% block="right eye"// Testing the wrapper functions that control the smile
lights.smileCycleRainbowTime(200, 3000)
basic.pause(500)
lights.smileShow(NeoPixelColors.Red)
basic.pause(500)
lights.smileShow(NeoPixelColors.Green)
basic.pause(500)
lights.smileShow(NeoPixelColors.Blue)
basic.pause(500)
lights.smileShow(NeoPixelColors.Black)
basic.pause(500)
lights.smileCycleRainbow(5)
for (let i = 0; i < 7; i++) {
lights.smileShowGraph(i, 7)
basic.pause(200)
}
// testing the ready made variable for the eyes neopixels
let eyesNeoPixels = lights.whichEye(gigglebotWhichEye.Both)
eyesNeoPixels.setPixelColor(gigglebotWhichEye.Left, NeoPixelColors.Green)
eyesNeoPixels.setPixelColor(gigglebotWhichEye.Right, NeoPixelColors.Yellow)
eyesNeoPixels.show()
// testing the ready made variable for the smile neoPixels
let smileNeoPixels = lights.smile()
smileNeoPixels.showColor(NeoPixelColors.Purple)
}