Skip to content

Commit

Permalink
Merge pull request #1 from CleoQc/master
Browse files Browse the repository at this point in the history
V0.1.3
  • Loading branch information
CleoQc authored Aug 14, 2018
2 parents 703f808 + e984a7b commit 936db96
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
32 changes: 32 additions & 0 deletions giggle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@

enum gigglebotWhichEye {
//% block="both eyes"
Both = 2,
//% block="left eye"
Left = 1,
//% block="right eye"
Right = 0
}

enum gigglebotEyeAction {
//% block="open"
Open,
//% block="close"
Close
}

enum gigglebotGigglePixels {
Right,
Left,
SmileOne,
SmileTwo,
SmileThree,
SmileFour,
SmileFive,
SmileSix,
SmileSeven

}


//% weight=99 color=#46BFB1 icon="\uf0d1"
//% groups='["other", "variables"]'
Expand All @@ -18,10 +47,12 @@ namespace lights {
eyeNeopixelLeft.setBrightness(10)
eyeNeopixelRight.setBrightness(10)
smileNeopixel.setBrightness(40)

for (let _i = 0; _i < gigglebotGigglePixels.SmileSeven; _i++) {
stripNeopixel.setPixelColor(_i, neopixel.colors(NeoPixelColors.Black))
}
stripNeopixel.show()

if (gigglebot.voltageBattery() < 3400) {
eyeColorLeft = neopixel.colors(NeoPixelColors.Red)
eyeColorRight = neopixel.colors(NeoPixelColors.Red)
Expand Down Expand Up @@ -139,6 +170,7 @@ namespace remote {
}

const packet = new radio.Packet();

/**
* Use this block on the GiggleBot to control it with a second micro:bit
* @param radioBlock eg:1
Expand Down
55 changes: 55 additions & 0 deletions giggletest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)



}
4 changes: 2 additions & 2 deletions pxt.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "giggle",
"version": "v0.1.0",
"version": "v0.1.3",
"dependencies": {
"core": "*",
"radio": "*",
"neopixel": "github:microsoft/pxt-neopixel#v0.6.7",
"gigglebot": "github:dexterind/pxt-gigglebot#v0.1.0"
"gigglebot": "github:dexterind/pxt-gigglebot#v0.1.3"
},
"description": "GiggleBot is a microbit rover by Dexter Industries, it offers a total of 9 neopixels, 2 line sensors, 2 light sensors, and 2 servos",
"files": [
Expand Down

0 comments on commit 936db96

Please sign in to comment.