-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pxt core bump 9.1.1x and more (#1038)
* bump-pxt-core Timely update of the pxt-core version to support the project. * active-item-fill-height-change * pxt-core-bump-9.1.14 * pxt-bump-9-1-15 * add-subcategories-planned-sens * ht-color-sen-add-lib * Remove-queryArr-and-infoArr Got rid of queryArr and infoArr, which I created to support the color sensor in the RawRgb mode in the simulator. * revert-ms-automation-ext Revert automation extension. * pxt-bump-9.1.16 * move-status-indicator-to-new-group Move the status indicator to a separate group. It was in a button group, but according to the ev3 manual it is not a button, so I created a separate group for it and output the code to a separate file. It's logical. * exitProgram-moved-from-buttons-to-program exitProgram has been moved from buttons to the program group. * bump-pxt-9.1.17 * pxt-bump-9.1.18 * pxt-bump-9.1.19 * i2c-sens-work-when-start-program The i2c sensors will work when the program starts. Before this, the i2c sensor started working only when other sensors were reconnected, calling detectDevices() again. * Update input.ts * Update input.ts * pxt-bump-9.1.21 * pxt-bump-9.1.23 * color-for-separator-lego-ana-microsoft-logos * Update style.less * Update style.less * revert-approvedRepos * Update targetconfig.json
- Loading branch information
Showing
14 changed files
with
206 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Patterns for lights under the buttons. | ||
*/ | ||
const enum StatusLight { | ||
//% block=off enumval=0 | ||
Off = 0, | ||
//% block=green enumval=1 | ||
Green = 1, | ||
//% block=red enumval=2 | ||
Red = 2, | ||
//% block=orange enumval=3 | ||
Orange = 3, | ||
//% block="green flash" enumval=4 | ||
GreenFlash = 4, | ||
//% block="red flash" enumval=5 | ||
RedFlash = 5, | ||
//% block="orange flash" enumval=6 | ||
OrangeFlash = 6, | ||
//% block="green pulse" enumval=7 | ||
GreenPulse = 7, | ||
//% block="red pulse" enumval=8 | ||
RedPulse = 8, | ||
//% block="orange pulse" enumval=9 | ||
OrangePulse = 9, | ||
} | ||
|
||
namespace brick { | ||
// the brick starts with the red color | ||
let currPattern: StatusLight = StatusLight.Off; | ||
|
||
/** | ||
* Gets the current light pattern. | ||
*/ | ||
//% weight=99 group="Indicator" | ||
//% help=brick/status-light | ||
export function statusLight() { | ||
return currPattern; | ||
} | ||
|
||
/** | ||
* Set lights. | ||
* @param pattern the lights pattern to use. eg: StatusLight.Orange | ||
*/ | ||
//% blockId=setLights block="set status light to %pattern" | ||
//% weight=100 group="Indicator" | ||
//% help=brick/set-status-light | ||
export function setStatusLight(pattern: StatusLight): void { | ||
if (currPattern === pattern) | ||
return | ||
currPattern = pattern; | ||
const cmd = output.createBuffer(2) | ||
cmd[0] = pattern + 48 | ||
brick.internal.getBtnsMM().write(cmd) | ||
} | ||
} |
Oops, something went wrong.