Compare commits

..

7 Commits

Author SHA1 Message Date
4e9d3aa413 0.0.10 2017-08-07 11:33:51 -07:00
1efad776e6 bump pxt-core to 2.0.6, 2017-08-07 11:33:46 -07:00
5e7af872b5 Add setLights shadow block 2017-08-07 10:19:38 -07:00
17683033b1 Add branch info 2017-08-07 12:15:56 +02:00
31f3d108c5 Update build instructions 2017-08-07 12:15:06 +02:00
b45bf7512c 0.0.9 2017-08-07 11:13:05 +02:00
2dec405a9b Catch errors from initAsync 2017-08-07 11:12:52 +02:00
6 changed files with 23 additions and 14 deletions

View File

@ -9,12 +9,12 @@ This repo contains the editor target hosted at https://lego.makecode.com
These instructions assume familiarity with dev tools and languages.
* install Node.js 6+
* install [yotta](http://docs.yottabuild.org/#installing)
* install Docker; make sure `docker` command is in your `PATH`
* (optional) install [Visual Studio Code](https://code.visualstudio.com/)
In a common folder,
* clone https://github.com/Microsoft/pxt to ``pxt`` folder
* clone https://github.com/Microsoft/pxt to ``pxt`` folder (currently, build against `freshcoat` branch)
* clone https://github.com/Microsoft/pxt-common-packages to ``pxt-common-packages`` folder
* clone https://github.com/Microsoft/pxt-ev3 to ``pxt-ev3`` folder
* go to ``pxt`` and run

View File

@ -121,13 +121,9 @@ namespace pxt.editor {
const res: pxt.editor.ExtensionResult = {
deployCoreAsync,
};
initAsync()
/*
.then(w => w.streamFileAsync("/tmp/serial.txt", buf => {
let str = Util.fromUTF8(Util.uint8ArrayToString(buf))
}))
*/
initAsync().catch(e => {
// probably no HID - we'll try this again upon deployment
})
return Promise.resolve<pxt.editor.ExtensionResult>(res);
}
}

View File

@ -20,6 +20,7 @@
"input.remoteTopRight": "Remote top-right button.",
"output.createBuffer": "Create a new zero-initialized buffer.",
"output.createBuffer|param|size": "number of bytes in the buffer",
"output.getPattern": "Pattern block.",
"output.setLights": "Set lights.",
"screen.clear": "Clear screen and reset font to normal.",
"screen.doubleIcon": "Double size of an icon.",

View File

@ -16,7 +16,8 @@
"input.remoteTopLeft|block": "remote top-left",
"input.remoteTopRight|block": "remote top-right",
"input|block": "input",
"output.setLights|block": "set lights %pattern",
"output.getPattern|block": "%pattern",
"output.setLights|block": "set lights %pattern=led_pattern",
"output|block": "output",
"screen|block": "screen",
"serial|block": "serial",

View File

@ -216,8 +216,8 @@ namespace output {
/**
* Set lights.
*/
//% blockId=setLights block="set lights %pattern"
export function setLights(pattern: LightsPattern): void {
//% blockId=setLights block="set lights %pattern=led_pattern"
export function setLights(pattern: number): void {
if (currPattern === pattern)
return
currPattern = pattern
@ -225,4 +225,15 @@ namespace output {
cmd[0] = pattern + 48
input.internal.getBtnsMM().write(cmd)
}
/**
* Pattern block.
*/
//% blockId=led_pattern block="%pattern"
//% shim=TD_ID colorSecondary="#6e9a36"
//% blockHidden=true
export function getPattern(pattern: LightsPattern): number {
return pattern;
}
}

View File

@ -1,6 +1,6 @@
{
"name": "pxt-ev3",
"version": "0.0.8",
"version": "0.0.10",
"description": "LEGO Mindstorms EV3 for Microsoft MakeCode",
"private": true,
"keywords": [
@ -40,7 +40,7 @@
},
"dependencies": {
"pxt-common-packages": "0.9.2",
"pxt-core": "2.0.2"
"pxt-core": "2.0.6"
},
"scripts": {
"test": "node node_modules/pxt-core/built/pxt.js travis"