Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for control messages #1192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/projects/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* [Dandelion](/projects/dandelion)
* [Watch Timer](/projects/watch-timer)
* [Magic Wand](/projects/magic-wand)
* [Legendary Gauntlets](/projects/wonder-woman-gauntlets)
* [Wonder Woman's Legendary Gauntlets](/projects/wonder-woman-gauntlets)
* [Headlamp](/projects/headlamp)
* [Energy glove](/examples/energy-glove)
* [Beaded Necklace](/projects/beaded-necklace)
Expand Down
4 changes: 3 additions & 1 deletion libs/base/_locales/base-jsdoc-strings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"Array": "Add, remove, and replace items in lists.",
"Array._pickRandom": "Return a random value from the array",
"Array._popStatement": "Remove the last element from an array and return it.",
"Array._removeAtStatement": "Remove the element at a certain index.",
"Array._shiftStatement": "Remove the first element from an array and return it. This method changes the length of the array.",
Expand Down Expand Up @@ -37,6 +38,7 @@
"Array.reverse": "Reverse the elements in an array. The first array element becomes the last, and the last array element becomes the first.",
"Array.set": "Store a value at a particular index",
"Array.set|param|index": "the zero-based position in the list to store the value, eg: 0",
"Array.set|param|value": "the value to insert, eg: 0",
"Array.shift": "Remove the first element from an array and return it. This method changes the length of the array.",
"Array.slice": "Return a section of an array.",
"Array.slice|param|end": "The end of the specified portion of the array. eg: 0",
Expand Down Expand Up @@ -188,7 +190,7 @@
"String.split": "Splits the string according to the separators",
"String.split|param|separator": "@param limit",
"String.substr": "Return a substring of the current string.",
"String.substr|param|length": "number of characters to extract",
"String.substr|param|length": "number of characters to extract, eg: 10",
"String.substr|param|start": "first character index; can be negative from counting from the end, eg:0",
"String.toLowerCase": "Converts the string to lower case characters.",
"String.trim": "Return a substring of the current string with whitespace removed from both ends",
Expand Down
1 change: 1 addition & 0 deletions libs/base/_locales/base-strings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"Array._pickRandom|block": "get random value from %list",
"Array._popStatement|block": "remove last value from %list",
"Array._removeAtStatement|block": "%list| remove value at %index",
"Array._shiftStatement|block": "remove first value from %list",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"@types/web-bluetooth": "0.0.4"
},
"dependencies": {
"pxt-common-packages": "8.1.1",
"pxt-core": "6.2.6"
"pxt-common-packages": "8.2.7",
"pxt-core": "6.4.2"
},
"scripts": {
"serve": "node node_modules/pxt-core/built/pxt.js serve",
Expand Down
5 changes: 4 additions & 1 deletion sim/dalboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ namespace pxsim {
TemperatureBoard,
InfraredBoard,
CapTouchBoard,
StorageBoard {
StorageBoard,
ControlMessageBoard {
// state & update logic for component services
_neopixelState: pxt.Map<CommonNeoPixelState>;
buttonState: CommonButtonState;
Expand All @@ -65,6 +66,7 @@ namespace pxsim {
touchButtonState: TouchButtonState;
irState: InfraredState;
storageState: StorageState;
controlMessageState: ControlMessageState;

invertAccelerometerYAxis = true;

Expand All @@ -81,6 +83,7 @@ namespace pxsim {

//components
this.storageState = new StorageState();
this.controlMessageState = new ControlMessageState(this);
this.builtinParts["neopixel"] = this.neopixelState(CPlayPinName.D8);
this.builtinParts["buttonpair"] = this.buttonState = new CommonButtonState();

Expand Down