Moving back to pxtcore v0 (#10)

* migrating to v0

* moving external repos to targetconfig

* reenabling sharing

* updating target

* missing dependencies

* updated pxt version

* fixing missing file

* ignore docs errors

* udpated readme

* bumping pxt

* moving setting to correct location

* missing blockly less
This commit is contained in:
Peli de Halleux 2017-12-12 10:55:00 -08:00 committed by GitHub
parent aa6b6daf45
commit 90fe68943e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 360 additions and 113 deletions

View File

@ -1,7 +1,7 @@
# Calliope target for PXT # Calliope target for Microsoft MakeCode
This target is hosted at https://makecode.calliope.cc.
This target allow to program a [Calliope](http://calliope.cc/) using
PXT ([Microsoft Programming Experience Toolkit](https://github.com/Microsoft/pxt)).
### BUILD COMMENTS ### BUILD COMMENTS

View File

@ -1,31 +1,126 @@
{ {
"Math.abs": "Returns the absolute value of a number (the value without regard to whether it is positive or negative). \nFor example, the absolute value of -5 is the same as the absolute value of 5.", "AcceleratorRange.EightG": "The accelerator measures forces up to 8 gravity",
"AcceleratorRange.FourG": "The accelerator measures forces up to 4 gravity",
"AcceleratorRange.OneG": "The accelerator measures forces up to 1 gravity",
"AcceleratorRange.TwoG": "The accelerator measures forces up to 2 gravity",
"Array": "Add, remove, and replace items in lists.\n\nAdd, remove, and replace items in lists.",
"Array.filter": "Return the elements of an array that meet the condition specified in a callback function.",
"Array.filter|param|callbackfn": "A function that accepts up to two arguments. The filter method calls the callbackfn function one time for each element in the array.",
"Array.get": "Get the value at a particular index.",
"Array.get|param|index": "the zero-based position in the list of the item, eg: 0",
"Array.indexOf": "Return the index of the first occurrence of a value in an array.",
"Array.indexOf|param|fromIndex": "The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.",
"Array.indexOf|param|item": "The value to locate in the array.",
"Array.insertAt": "Insert the value at a particular index, increase the array length by 1.",
"Array.insertAt|param|index": "the zero-based position in the list to insert the value, eg: 0",
"Array.insertAt|param|value": "to insert, eg: 0",
"Array.length": "Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.",
"Array.map": "Call a defined callback function on each element of an array, and return an array containing the results.",
"Array.map|param|callbackfn": "A function that accepts up to two arguments. The map method calls the callbackfn function one time for each element in the array.",
"Array.pop": "Remove the last element from an array and return it.",
"Array.push": "Append a new elements to an array.",
"Array.push|param|item": "to append to the Array.",
"Array.reduce": "Call the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.",
"Array.reduce|param|callbackfn": "A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the array.",
"Array.reduce|param|initialValue": "Initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.",
"Array.removeAt": "Remove the element at a certain index.",
"Array.removeAt|param|index": "the zero-based position in the list to remove the value from, eg: 0",
"Array.removeElement": "Remove the first occurence of an object. Return true if removed.",
"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.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",
"Array.slice|param|start": "The beginning of the specified portion of the array. eg: 0",
"Array.sort": "Sort the elements of an array in place and returns the array. The sort is not necessarily stable.",
"Array.splice": "Remove elements from an array.",
"Array.splice|param|deleteCount": "The number of elements to remove. eg: 0",
"Array.splice|param|start": "The zero-based location in the array from which to start removing elements. eg: 0",
"Array.unshift": "Add one element to the beginning of an array and return the new length of the array.",
"Array.unshift|param|value": "to insert at the start of the Array.",
"Boolean.toString": "Returns a string representation of an object.",
"Buffer.fill": "Fill (a fragment) of the buffer with given value.",
"Buffer.getNumber": "Read a number in specified format from the buffer.",
"Buffer.length": "Returns the length of a Buffer object.",
"Buffer.rotate": "Rotate buffer left in place.",
"Buffer.rotate|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus start. eg: -1",
"Buffer.rotate|param|offset": "number of bytes to shift; use negative value to shift right",
"Buffer.rotate|param|start": "start offset in buffer. Default is 0.",
"Buffer.setNumber": "Write a number in specified format in the buffer.",
"Buffer.shift": "Shift buffer left in place, with zero padding.",
"Buffer.shift|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus start. eg: -1",
"Buffer.shift|param|offset": "number of bytes to shift; use negative value to shift right",
"Buffer.shift|param|start": "start offset in buffer. Default is 0.",
"Buffer.slice": "Return a copy of a fragment of a buffer.",
"Buffer.write": "Write contents of `src` at `dstOffset` in current buffer.",
"Colors": "Well known colors",
"EventCreationMode": "How to create the event.",
"EventCreationMode.CreateAndFire": "MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!).",
"EventCreationMode.CreateOnly": "MicroBitEvent is initialised, and no further processing takes place.",
"Gesture.FreeFall": "Raised when the board is falling!",
"Gesture.LogoDown": "Raised when the logo is downward and the screen is vertical",
"Gesture.LogoUp": "Raised when the logo is upward and the screen is vertical",
"Gesture.ScreenDown": "Raised when the screen is pointing up and the board is horizontal",
"Gesture.ScreenUp": "Raised when the screen is pointing down and the board is horizontal",
"Gesture.Shake": "Raised when shaken",
"Gesture.SixG": "Raised when a 6G shock is detected",
"Gesture.ThreeG": "Raised when a 3G shock is detected",
"Gesture.TiltLeft": "Raised when the screen is pointing left",
"Gesture.TiltRight": "Raised when the screen is pointing right",
"Image.clear": "Sets all pixels off.",
"Image.height": "Gets the height in rows (always 5)",
"Image.pixel": "Get the pixel state at position ``(x,y)``",
"Image.pixelBrightness": "Gets the pixel brightness ([0..255]) at a given position",
"Image.pixel|param|x": "TODO",
"Image.pixel|param|y": "TODO",
"Image.plotFrame": "Draws the ``index``-th frame of the image on the screen.",
"Image.plotFrame|param|xOffset": "column index to start displaying the image",
"Image.plotImage": "Plots the image at a given column to the screen",
"Image.scrollImage": "Scrolls an image .",
"Image.scrollImage|param|frameOffset": "x offset moved on each animation step, eg: 1, 2, 5",
"Image.scrollImage|param|interval": "time between each animation step in milli seconds, eg: 200",
"Image.setPixel": "Set a pixel state at position ``(x,y)``",
"Image.setPixelBrightness": "Sets a specific pixel brightness at a given position",
"Image.setPixel|param|value": "TODO",
"Image.setPixel|param|x": "TODO",
"Image.setPixel|param|y": "TODO",
"Image.showFrame": "Shows a particular frame of the image strip.",
"Image.showFrame|param|frame": "TODO",
"Image.showImage": "Shows an frame from the image at offset ``x offset``.",
"Image.showImage|param|xOffset": "column index to start displaying the image",
"Image.width": "Gets the width in columns",
"Math": "More complex operations with numbers.",
"Math.abs": "Returns the absolute value of a number (the value without regard to whether it is positive or negative).\nFor example, the absolute value of -5 is the same as the absolute value of 5.",
"Math.abs|param|x": "A numeric expression for which the absolute value is needed.", "Math.abs|param|x": "A numeric expression for which the absolute value is needed.",
"Math.max": "Returns the larger of two supplied numeric expressions.", "Math.max": "Returns the larger of two supplied numeric expressions.",
"Math.min": "Returns the smaller of two supplied numeric expressions.", "Math.min": "Returns the smaller of two supplied numeric expressions.",
"Math.pow": "Returns the value of a base expression taken to a specified power.", "Math.pow": "Return the value of a base expression taken to a specified power.",
"Math.pow|param|x": "The base value of the expression.", "Math.pow|param|x": "The base value of the expression.",
"Math.pow|param|y": "The exponent value of the expression.", "Math.pow|param|y": "The exponent value of the expression.",
"Math.random": "Returns a pseudorandom number between 0 and `max`.", "Math.random": "Return a pseudorandom number between 0 and `limit`.",
"Math.randomBoolean": "Generates a `true` or `false` value randomly, just like flipping a coin.", "Math.randomBoolean": "Generates a `true` or `false` value randomly, just like flipping a coin.",
"Math.random|param|limit": "the upper bound of the number generated, eg: 4",
"Math.sign": "Returns the sign of the x, indicating whether x is positive, negative or zero.", "Math.sign": "Returns the sign of the x, indicating whether x is positive, negative or zero.",
"Math.sign|param|x": "The numeric expression to test", "Math.sign|param|x": "The numeric expression to test",
"Math.sqrt": "Returns the square root of a number.", "Math.sqrt": "Return the square root of a number.",
"Math.sqrt|param|x": "A numeric expression.", "Math.sqrt|param|x": "A numeric expression.",
"String.charAt": "Returns the character at the specified index.", "Number.toString": "Return a string representation of a number.",
"String.charAt|param|index": "The zero-based index of the desired character.", "String": "Combine, split, and search text strings.\n\nCombine, split, and search text strings.",
"String.charCodeAt": "Returns the Unicode value of the character at the specified location.", "String.charAt": "Return the character at the specified index.",
"String.charAt|param|index": "The zero-based index of the desired character, eg: 0",
"String.charCodeAt": "Return the Unicode value of the character at the specified location.",
"String.charCodeAt|param|index": "The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.", "String.charCodeAt|param|index": "The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.",
"String.compare": "Determines whether relative order of two strings (in ASCII encoding).", "String.compare": "See how the order of characters in two strings is different (in ASCII encoding).",
"String.compare|param|that": "String to compare to target string", "String.compare|param|that": "String to compare to target string",
"String.concat": "Returns a string that contains the concatenation of two or more strings.", "String.concat": "Returns a string that contains the concatenation of two or more strings.",
"String.concat|param|other": "The string to append to the end of the string.", "String.concat|param|other": "The string to append to the end of the string, eg: \"add me!\"",
"String.fromCharCode": "Make a string from the given ASCII character code.", "String.fromCharCode": "Make a string from the given ASCII character code.",
"String.isEmpty": "Returns a value indicating if the string is empty", "String.isEmpty": "Returns a value indicating if the string is empty",
"String.length": "Returns the length of a String object.", "String.length": "Return the length of a String object.",
"String.substr": "Return substring of the current string.", "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: 3",
"String.substr|param|start": "first character index; can be negative from counting from the end, eg:0", "String.substr|param|start": "first character index; can be negative from counting from the end, eg: 0",
"basic": "Provides access to basic micro:bit functionality.\n\nProvides access to basic micro:bit functionality.", "basic": "Provides access to basic micro:bit functionality.\n\nProvides access to basic micro:bit functionality.",
"basic.clearScreen": "Turn off all LEDs", "basic.clearScreen": "Turn off all LEDs",
"basic.color": "Converts the color name to a number", "basic.color": "Converts the color name to a number",
@ -72,6 +167,58 @@
"control.waitMicros": "Blocks the current fiber for the given microseconds", "control.waitMicros": "Blocks the current fiber for the given microseconds",
"control.waitMicros|param|micros": "number of micro-seconds to wait. eg: 4", "control.waitMicros|param|micros": "number of micro-seconds to wait. eg: 4",
"game": "A single-LED sprite game engine", "game": "A single-LED sprite game engine",
"game.LedSprite.blink": "Reports the ``blink`` duration of a sprite",
"game.LedSprite.brightness": "Reports the ``brightness` of a sprite on the LED screen",
"game.LedSprite.change": "Changes a property of the sprite",
"game.LedSprite.changeBlinkBy": "Changes the ``blink`` duration by the given amount of millisecons",
"game.LedSprite.changeBlinkBy|param|ms": "TODO",
"game.LedSprite.changeBrightnessBy": "Changes the ``y`` position by the given amount",
"game.LedSprite.changeBrightnessBy|param|value": "TODO",
"game.LedSprite.changeDirectionBy": "Changes the ``direction`` position by the given amount by turning right",
"game.LedSprite.changeDirectionBy|param|angle": "TODO",
"game.LedSprite.changeXBy": "Changes the ``x`` position by the given amount",
"game.LedSprite.changeXBy|param|x": "TODO",
"game.LedSprite.changeYBy": "Changes the ``y`` position by the given amount",
"game.LedSprite.changeYBy|param|y": "TODO",
"game.LedSprite.change|param|property": "the name of the property to change",
"game.LedSprite.change|param|value": "amount of change, eg: 1",
"game.LedSprite.delete": "Deletes the sprite from the game engine. All further operation of the sprite will not have any effect.",
"game.LedSprite.delete|param|sprite": "TODO",
"game.LedSprite.direction": "Reports the current direction of a sprite",
"game.LedSprite.get": "Gets a property of the sprite",
"game.LedSprite.get|param|property": "the name of the property to change",
"game.LedSprite.goTo": "Go to this position on the screen",
"game.LedSprite.goTo|param|x": "TODO",
"game.LedSprite.goTo|param|y": "TODO",
"game.LedSprite.ifOnEdgeBounce": "If touching the edge of the stage, then bounce away.",
"game.LedSprite.isTouching": "Reports true if sprite is touching specified sprite",
"game.LedSprite.isTouchingEdge": "Reports true if sprite is touching an edge",
"game.LedSprite.isTouching|param|other": "TODO",
"game.LedSprite.move": "Move a certain number of LEDs",
"game.LedSprite.move|param|leds": "number of leds to move, eg: 1, -1",
"game.LedSprite.off": "Turns off the sprite (on by default)",
"game.LedSprite.on": "Turns on the sprite (on by default)",
"game.LedSprite.set": "Sets a property of the sprite",
"game.LedSprite.setBlink": "Sets the blink duration interval in millisecond.",
"game.LedSprite.setBlink|param|ms": "TODO",
"game.LedSprite.setBrightness": "Set the ``brightness`` of a sprite",
"game.LedSprite.setBrightness|param|brightness": "TODO",
"game.LedSprite.setDirection": "Set the direction of the current sprite, rounded to the nearest multiple of 45",
"game.LedSprite.setDirection|param|degrees": "TODO",
"game.LedSprite.setX": "Set the ``x`` position of a sprite",
"game.LedSprite.setX|param|x": "TODO",
"game.LedSprite.setY": "Set the ``y`` position of a sprite",
"game.LedSprite.setY|param|y": "TODO",
"game.LedSprite.set|param|property": "the name of the property to change",
"game.LedSprite.turn": "Turn the sprite",
"game.LedSprite.turnLeft": "Turn to the left (counter-clockwise)",
"game.LedSprite.turnLeft|param|degrees": "TODO",
"game.LedSprite.turnRight": "Turn to the right (clockwise)",
"game.LedSprite.turnRight|param|degrees": "TODO",
"game.LedSprite.turn|param|degrees": "angle in degrees to turn, eg: 45, 90, 180, 135",
"game.LedSprite.turn|param|direction": "left or right",
"game.LedSprite.x": "Reports the ``x`` position of a sprite on the LED screen",
"game.LedSprite.y": "Reports the ``y`` position of a sprite on the LED screen",
"game.addLife": "Adds life points to the current life", "game.addLife": "Adds life points to the current life",
"game.addLife|param|lives": "TODO", "game.addLife|param|lives": "TODO",
"game.addScore": "Adds points to the current score", "game.addScore": "Adds points to the current score",
@ -190,6 +337,7 @@
"music.setTempo": "Sets the tempo to the specified amount", "music.setTempo": "Sets the tempo to the specified amount",
"music.setTempo|param|bpm": "The new tempo in beats per minute, eg: 120", "music.setTempo|param|bpm": "The new tempo in beats per minute, eg: 120",
"music.tempo": "Returns the tempo in beats per minute. Tempo is the speed (bpm = beats per minute) at which notes play. The larger the tempo value, the faster the notes will play.", "music.tempo": "Returns the tempo in beats per minute. Tempo is the speed (bpm = beats per minute) at which notes play. The larger the tempo value, the faster the notes will play.",
"parseInt": "Convert A string to an integer.",
"pins": "Control currents in Pins for analog/digital signals, servos, i2c, ...", "pins": "Control currents in Pins for analog/digital signals, servos, i2c, ...",
"pins.analogPitch": "Emits a Pulse-width modulation (PWM) signal to the current pitch pin. Use `analog set pitch pin` to define the pitch pin.", "pins.analogPitch": "Emits a Pulse-width modulation (PWM) signal to the current pitch pin. Use `analog set pitch pin` to define the pitch pin.",
"pins.analogPitch|param|frequency": "TODO", "pins.analogPitch|param|frequency": "TODO",

View File

@ -7,6 +7,16 @@
"AcceleratorRange.OneG|block": "1g", "AcceleratorRange.OneG|block": "1g",
"AcceleratorRange.TwoG": "The accelerator measures forces up to 2 gravity", "AcceleratorRange.TwoG": "The accelerator measures forces up to 2 gravity",
"AcceleratorRange.TwoG|block": "2g", "AcceleratorRange.TwoG|block": "2g",
"Array.indexOf|block": "%list| find index of %value",
"Array.insertAt|block": "%list| insert at %index| value %value",
"Array.length|block": "length of %VALUE",
"Array.pop|block": "get and remove last value from %list",
"Array.push|block": "%list| add value %value| to end",
"Array.removeAt|block": "%list| remove value at %index",
"Array.reverse|block": "reverse %list",
"Array.shift|block": "get and remove first value from %list",
"Array.unshift|block": "%list| insert %value| at beginning",
"Array|block": "Array",
"BaudRate.BaudRate115200|block": "115200", "BaudRate.BaudRate115200|block": "115200",
"BaudRate.BaudRate56700|block": "57600", "BaudRate.BaudRate56700|block": "57600",
"BaudRate.BaudRate9600|block": "9600", "BaudRate.BaudRate9600|block": "9600",
@ -101,12 +111,15 @@
"IconNames.Triangle|block": "triangle", "IconNames.Triangle|block": "triangle",
"IconNames.Umbrella|block": "umbrella", "IconNames.Umbrella|block": "umbrella",
"IconNames.Yes|block": "yes", "IconNames.Yes|block": "yes",
"Image.scrollImage|block": "scroll image %sprite|with offset %frameoffset|and interval (ms) %delay",
"Image.showImage|block": "show image %sprite|at offset %offset",
"LedSpriteProperty.Blink|block": "blink", "LedSpriteProperty.Blink|block": "blink",
"LedSpriteProperty.Brightness|block": "brightness", "LedSpriteProperty.Brightness|block": "brightness",
"LedSpriteProperty.Direction|block": "direction", "LedSpriteProperty.Direction|block": "direction",
"LedSpriteProperty.X|block": "x", "LedSpriteProperty.X|block": "x",
"LedSpriteProperty.Y|block": "y", "LedSpriteProperty.Y|block": "y",
"Math.randomBoolean|block": "pick random true or false", "Math.randomBoolean|block": "pick random true or false",
"Math.random|block": "pick random 0 to %limit",
"Math|block": "Math", "Math|block": "Math",
"Motor.AB|block": "A and B", "Motor.AB|block": "A and B",
"MotorCommand.Break|block": "break", "MotorCommand.Break|block": "break",
@ -145,6 +158,7 @@
"basic.pause|block": "pause (ms) %pause", "basic.pause|block": "pause (ms) %pause",
"basic.rgbw|block": "red %red|green %green|blue %blue|white %white", "basic.rgbw|block": "red %red|green %green|blue %blue|white %white",
"basic.setLedColor|block": "set led to %color=color_id", "basic.setLedColor|block": "set led to %color=color_id",
"basic.showArrow|block": "show arrow %i=device_arrow",
"basic.showIcon|block": "show icon %i", "basic.showIcon|block": "show icon %i",
"basic.showLeds|block": "show leds", "basic.showLeds|block": "show leds",
"basic.showNumber|block": "show|number %number", "basic.showNumber|block": "show|number %number",
@ -162,14 +176,25 @@
"control.reset|block": "reset", "control.reset|block": "reset",
"control.waitMicros|block": "wait (µs)%micros", "control.waitMicros|block": "wait (µs)%micros",
"control|block": "control", "control|block": "control",
"game.LedSprite.change|block": "%sprite|change %property|by %value",
"game.LedSprite.get|block": "%sprite|%property",
"game.LedSprite.ifOnEdgeBounce|block": "%sprite|if on edge, bounce",
"game.LedSprite.isTouchingEdge|block": "%sprite|touching edge?",
"game.LedSprite.isTouching|block": "%sprite|touching %other|?",
"game.LedSprite.move|block": "%sprite|move by %leds",
"game.LedSprite.set|block": "%sprite|set %property|to %value",
"game.LedSprite.turn|block": "%sprite|turn %direction|by (°) %degrees",
"game.addScore|block": "change score by|%points", "game.addScore|block": "change score by|%points",
"game.createSprite|block": "create sprite at|x: %x|y: %y", "game.createSprite|block": "create sprite at|x: %x|y: %y",
"game.gameOver|block": "game over", "game.gameOver|block": "game over",
"game.score|block": "score", "game.score|block": "score",
"game.startCountdown|block": "start countdown|(ms) %duration", "game.startCountdown|block": "start countdown|(ms) %duration",
"game|block": "game", "game|block": "game",
"images.arrowImage|block": "arrow image %i=device_arrow",
"images.arrowNumber|block": "%arrow",
"images.createBigImage|block": "create big image", "images.createBigImage|block": "create big image",
"images.createImage|block": "create image", "images.createImage|block": "create image",
"images.iconImage|block": "icon image %i",
"images|block": "images", "images|block": "images",
"input.acceleration|block": "acceleration (mg)|%NAME", "input.acceleration|block": "acceleration (mg)|%NAME",
"input.buttonIsPressed|block": "button|%NAME|is pressed", "input.buttonIsPressed|block": "button|%NAME|is pressed",
@ -208,6 +233,7 @@
"music.setTempo|block": "set tempo to (bpm)|%value", "music.setTempo|block": "set tempo to (bpm)|%value",
"music.tempo|block": "tempo (bpm)", "music.tempo|block": "tempo (bpm)",
"music|block": "music", "music|block": "music",
"parseInt|block": "parse to integer %text",
"pins.analogPitch|block": "analog pitch %frequency|for (ms) %ms", "pins.analogPitch|block": "analog pitch %frequency|for (ms) %ms",
"pins.analogReadPin|block": "analog read|pin %name", "pins.analogReadPin|block": "analog read|pin %name",
"pins.analogSetPeriod|block": "analog set period|pin %pin|to (µs)%micros", "pins.analogSetPeriod|block": "analog set period|pin %pin|to (µs)%micros",
@ -238,15 +264,23 @@
"serial.writeString|block": "serial|write string %text", "serial.writeString|block": "serial|write string %text",
"serial.writeValue|block": "serial|write value %name|= %value", "serial.writeValue|block": "serial|write value %name|= %value",
"serial|block": "serial", "serial|block": "serial",
"{id:category}Array": "Array",
"{id:category}Arrays": "Arrays",
"{id:category}Basic": "Basic", "{id:category}Basic": "Basic",
"{id:category}Boolean": "Boolean",
"{id:category}Buffer": "Buffer",
"{id:category}Console": "Console",
"{id:category}Control": "Control", "{id:category}Control": "Control",
"{id:category}Game": "Game", "{id:category}Game": "Game",
"{id:category}Helpers": "Helpers",
"{id:category}Image": "Image",
"{id:category}Images": "Images", "{id:category}Images": "Images",
"{id:category}Input": "Input", "{id:category}Input": "Input",
"{id:category}Led": "Led", "{id:category}Led": "Led",
"{id:category}Math": "Math", "{id:category}Math": "Math",
"{id:category}Motors": "Motors", "{id:category}Motors": "Motors",
"{id:category}Music": "Music", "{id:category}Music": "Music",
"{id:category}Number": "Number",
"{id:category}Pins": "Pins", "{id:category}Pins": "Pins",
"{id:category}Serial": "Serial", "{id:category}Serial": "Serial",
"{id:category}String": "String", "{id:category}String": "String",

42
libs/core/enums.d.ts vendored
View File

@ -5,7 +5,7 @@ declare namespace basic {
} }
declare enum Button { declare const enum Button {
A = 1, // MICROBIT_ID_BUTTON_A A = 1, // MICROBIT_ID_BUTTON_A
B = 2, // MICROBIT_ID_BUTTON_B B = 2, // MICROBIT_ID_BUTTON_B
//% block="A+B" //% block="A+B"
@ -13,7 +13,7 @@ declare namespace basic {
} }
declare enum Dimension { declare const enum Dimension {
//% block=x //% block=x
X = 0, X = 0,
//% block=y //% block=y
@ -25,7 +25,7 @@ declare namespace basic {
} }
declare enum Rotation { declare const enum Rotation {
//% block=pitch //% block=pitch
Pitch = 0, Pitch = 0,
//% block=roll //% block=roll
@ -33,7 +33,7 @@ declare namespace basic {
} }
declare enum TouchPin { declare const enum TouchPin {
P0 = 19, // MICROBIT_ID_IO_P12 P0 = 19, // MICROBIT_ID_IO_P12
P1 = 7, // MICROBIT_ID_IO_P0 P1 = 7, // MICROBIT_ID_IO_P0
P2 = 8, // MICROBIT_ID_IO_P1 P2 = 8, // MICROBIT_ID_IO_P1
@ -41,7 +41,7 @@ declare namespace basic {
} }
declare enum AcceleratorRange { declare const enum AcceleratorRange {
/** /**
* The accelerator measures forces up to 1 gravity * The accelerator measures forces up to 1 gravity
*/ */
@ -65,7 +65,7 @@ declare namespace basic {
} }
declare enum Gesture { declare const enum Gesture {
/** /**
* Raised when shaken * Raised when shaken
*/ */
@ -125,7 +125,7 @@ declare namespace input {
* How to create the event. * How to create the event.
*/ */
declare enum EventCreationMode { declare const enum EventCreationMode {
/** /**
* MicroBitEvent is initialised, and no further processing takes place. * MicroBitEvent is initialised, and no further processing takes place.
*/ */
@ -137,7 +137,7 @@ declare namespace input {
} }
declare enum EventBusSource { declare const enum EventBusSource {
MICROBIT_ID_BUTTON_A = 1, // MICROBIT_ID_BUTTON_A MICROBIT_ID_BUTTON_A = 1, // MICROBIT_ID_BUTTON_A
MICROBIT_ID_BUTTON_B = 2, // MICROBIT_ID_BUTTON_B MICROBIT_ID_BUTTON_B = 2, // MICROBIT_ID_BUTTON_B
MICROBIT_ID_BUTTON_AB = 26, // MICROBIT_ID_BUTTON_AB MICROBIT_ID_BUTTON_AB = 26, // MICROBIT_ID_BUTTON_AB
@ -171,7 +171,7 @@ declare namespace input {
} }
declare enum EventBusValue { declare const enum EventBusValue {
MICROBIT_EVT_ANY = 0, // MICROBIT_EVT_ANY MICROBIT_EVT_ANY = 0, // MICROBIT_EVT_ANY
MICROBIT_BUTTON_EVT_CLICK = 3, // MICROBIT_BUTTON_EVT_CLICK MICROBIT_BUTTON_EVT_CLICK = 3, // MICROBIT_BUTTON_EVT_CLICK
MICROBIT_RADIO_EVT_DATAGRAM = 1, // MICROBIT_RADIO_EVT_DATAGRAM MICROBIT_RADIO_EVT_DATAGRAM = 1, // MICROBIT_RADIO_EVT_DATAGRAM
@ -236,7 +236,7 @@ declare namespace control {
} }
declare enum DisplayMode { declare const enum DisplayMode {
//% block="black and white" //% block="black and white"
BackAndWhite = 0, // DISPLAY_MODE_BLACK_AND_WHITE BackAndWhite = 0, // DISPLAY_MODE_BLACK_AND_WHITE
//% block="greyscale" //% block="greyscale"
@ -247,7 +247,7 @@ declare namespace led {
} }
declare enum MotorCommand { declare const enum MotorCommand {
//% block=coast //% block=coast
Coast = 0, Coast = 0,
//% block=break //% block=break
@ -257,7 +257,7 @@ declare namespace led {
} }
declare enum Motor { declare const enum Motor {
A = 0, A = 0,
B = 1, B = 1,
//% block="A and B" //% block="A and B"
@ -267,7 +267,7 @@ declare namespace motors {
} }
declare enum DigitalPin { declare const enum DigitalPin {
P0 = 19, // MICROBIT_ID_IO_P12 P0 = 19, // MICROBIT_ID_IO_P12
P1 = 7, // MICROBIT_ID_IO_P0 P1 = 7, // MICROBIT_ID_IO_P0
P2 = 8, // MICROBIT_ID_IO_P1 P2 = 8, // MICROBIT_ID_IO_P1
@ -288,7 +288,7 @@ declare namespace motors {
} }
declare enum AnalogPin { declare const enum AnalogPin {
P1 = 7, // MICROBIT_ID_IO_P0 P1 = 7, // MICROBIT_ID_IO_P0
P2 = 8, // MICROBIT_ID_IO_P1 P2 = 8, // MICROBIT_ID_IO_P1
C4 = 10, // MICROBIT_ID_IO_P3 C4 = 10, // MICROBIT_ID_IO_P3
@ -300,13 +300,13 @@ declare namespace motors {
} }
declare enum PulseValue { declare const enum PulseValue {
High = 4, // MICROBIT_PIN_EVT_PULSE_HI High = 4, // MICROBIT_PIN_EVT_PULSE_HI
Low = 5, // MICROBIT_PIN_EVT_PULSE_LO Low = 5, // MICROBIT_PIN_EVT_PULSE_LO
} }
declare enum PinPullMode { declare const enum PinPullMode {
//% block="down" //% block="down"
PullDown = 0, PullDown = 0,
//% block="up" //% block="up"
@ -316,7 +316,7 @@ declare namespace motors {
} }
declare enum PinEventType { declare const enum PinEventType {
//% block="edge" //% block="edge"
Edge = 1, // MICROBIT_PIN_EVENT_ON_EDGE Edge = 1, // MICROBIT_PIN_EVENT_ON_EDGE
//% block="pulse" //% block="pulse"
@ -328,7 +328,7 @@ declare namespace motors {
} }
declare enum SerialPin { declare const enum SerialPin {
C16 = 9, // MICROBIT_ID_IO_P2 C16 = 9, // MICROBIT_ID_IO_P2
C17 = 15, // MICROBIT_ID_IO_P8 C17 = 15, // MICROBIT_ID_IO_P8
P0 = 19, // MICROBIT_ID_IO_P12 P0 = 19, // MICROBIT_ID_IO_P12
@ -338,7 +338,7 @@ declare namespace motors {
} }
declare enum BaudRate { declare const enum BaudRate {
//% block=115200 //% block=115200
BaudRate115200 = 115200, BaudRate115200 = 115200,
//% block=57600 //% block=57600
@ -348,7 +348,7 @@ declare namespace motors {
} }
declare enum Delimiters { declare const enum Delimiters {
//% block="new line" //% block="new line"
NewLine = 1, NewLine = 1,
//% block="," //% block=","
@ -366,7 +366,7 @@ declare namespace serial {
} }
declare enum NumberFormat { declare const enum NumberFormat {
Int8LE = 1, Int8LE = 1,
UInt8LE = 2, UInt8LE = 2,
Int16LE = 3, Int16LE = 3,

View File

@ -1,7 +1,7 @@
// Auto-generated. Do not edit. // Auto-generated. Do not edit.
declare enum MesCameraEvent { declare const enum MesCameraEvent {
//% block="take photo" //% block="take photo"
TakePhoto = 3, // MES_CAMERA_EVT_TAKE_PHOTO TakePhoto = 3, // MES_CAMERA_EVT_TAKE_PHOTO
//% block="start video capture" //% block="start video capture"
@ -21,7 +21,7 @@
} }
declare enum MesAlertEvent { declare const enum MesAlertEvent {
//% block="display toast" //% block="display toast"
DisplayToast = 1, // MES_ALERT_EVT_DISPLAY_TOAST DisplayToast = 1, // MES_ALERT_EVT_DISPLAY_TOAST
//% block="vibrate" //% block="vibrate"
@ -47,7 +47,7 @@
} }
declare enum MesDeviceInfo { declare const enum MesDeviceInfo {
//% block="incoming call" //% block="incoming call"
IncomingCall = 7, // MES_DEVICE_INCOMING_CALL IncomingCall = 7, // MES_DEVICE_INCOMING_CALL
//% block="incoming message" //% block="incoming message"
@ -65,7 +65,7 @@
} }
declare enum MesRemoteControlEvent { declare const enum MesRemoteControlEvent {
//% block="play" //% block="play"
play = 1, // MES_REMOTE_CONTROL_EVT_PLAY play = 1, // MES_REMOTE_CONTROL_EVT_PLAY
//% block="pause" //% block="pause"
@ -87,7 +87,7 @@
} }
declare enum MesDpadButtonInfo { declare const enum MesDpadButtonInfo {
//% block="A down" //% block="A down"
ADown = 1, // MES_DPAD_BUTTON_A_DOWN ADown = 1, // MES_DPAD_BUTTON_A_DOWN
//% block="A up" //% block="A up"

View File

@ -1,5 +1,10 @@
{ {
"radio": "Communicate data using radio packets", "radio": "Communicate data using radio packets",
"radio.Packet.receivedNumber": "The number payload if a number was sent in this packet (via ``sendNumber()`` or ``sendValue()``)\nor 0 if this packet did not contain a number.",
"radio.Packet.receivedString": "The string payload if a string was sent in this packet (via ``sendString()`` or ``sendValue()``)\nor the empty string if this packet did not contain a string.",
"radio.Packet.serial": "The serial number of the sender of the packet or 0 if the sender did not sent their serial number.",
"radio.Packet.signal": "The received signal strength indicator (RSSI) of the packet.",
"radio.Packet.time": "The system time of the sender of the packet at the time the packet was sent.",
"radio.onDataPacketReceived": "Registers code to run when the radio receives a packet. Also takes the\nreceived packet from the radio queue.", "radio.onDataPacketReceived": "Registers code to run when the radio receives a packet. Also takes the\nreceived packet from the radio queue.",
"radio.onDataReceived": "Registers code to run when a packet is received over radio.", "radio.onDataReceived": "Registers code to run when a packet is received over radio.",
"radio.receiveNumber": "Reads the next packet from the radio queue and returns the packet's number\npayload or 0 if the packet did not contain a number.", "radio.receiveNumber": "Reads the next packet from the radio queue and returns the packet's number\npayload or 0 if the packet did not contain a number.",

View File

@ -31,10 +31,12 @@
"devDependencies": { "devDependencies": {
"typescript": "^1.8.7", "typescript": "^1.8.7",
"less": "^2.6.0", "less": "^2.6.0",
"rtlcss": "^2.1.2",
"autoprefixer": "^6.7.6",
"semantic-ui-less": "^2.2.4" "semantic-ui-less": "^2.2.4"
}, },
"dependencies": { "dependencies": {
"pxt-core": "1.0.20" "pxt-core": "0.14.30"
}, },
"scripts": { "scripts": {
"test": "node node_modules/pxt-core/built/pxt.js travis" "test": "node node_modules/pxt-core/built/pxt.js travis"

View File

@ -1,31 +1,21 @@
{ {
"id": "calliope", "id": "calliopemini",
"name": " calliope", "name": " calliope mini",
"nickname": "mini", "nickname": "mini",
"title": "calliope mini - Blocks / Javascript editor", "title": "Calliope mini - Blocks / Javascript editor",
"description": "A Blocks / JavaScript code editor for the calliope mini.", "description": "A Blocks / JavaScript code editor for the calliope mini.",
"corepkg": "core", "corepkg": "core",
"bundleddirs": [ "bundleddirs": [
"libs/core", "libs/core",
"libs/radio", "libs/radio",
"libs/devices", "libs/devices",
"libs/bluetooth", "libs/bluetooth"
"libs/pxt-calliope-modem",
"libs/pxt-calliope-bc95",
"libs/pxt-calliope-esp",
"libs/pxt-calliope-bunt",
"libs/pxt-isl29125",
"libs/pxt-ubirch",
"libs/Grove",
"libs/pxt-ssd1306-microbit"
], ],
"cloud": { "cloud": {
"workspace": false, "workspace": false,
"packages": true, "packages": true,
"sharing": false, "sharing": true,
"publishing": false, "publishing": false,
"preferredPackages": [
],
"githubPackages": true "githubPackages": true
}, },
"compile": { "compile": {
@ -197,8 +187,8 @@
"footerLogo": "./static/Calliopeminieditor.svg", "footerLogo": "./static/Calliopeminieditor.svg",
"cardLogo": "./static/icons/apple-touch-icon.png", "cardLogo": "./static/icons/apple-touch-icon.png",
"appLogo": "./static/icons/apple-touch-icon.png", "appLogo": "./static/icons/apple-touch-icon.png",
"homeUrl": "https://calliope.cc/", "homeUrl": "https://makecode.calliope.cc/",
"embedUrl": "https://pxt.calliope.cc/", "embedUrl": "https://makecode.calliope.cc/",
"privacyUrl": "https://go.microsoft.com/fwlink/?LinkId=521839", "privacyUrl": "https://go.microsoft.com/fwlink/?LinkId=521839",
"termsOfUseUrl": "https://go.microsoft.com/fwlink/?LinkID=206977", "termsOfUseUrl": "https://go.microsoft.com/fwlink/?LinkID=206977",
"githubUrl": "https://github.com/Microsoft/pxt-calliope", "githubUrl": "https://github.com/Microsoft/pxt-calliope",
@ -207,39 +197,14 @@
"organizationUrl": "https://makecode.com/", "organizationUrl": "https://makecode.com/",
"organizationLogo": "./static/Microsoft-logo_rgb_c-gray-square.png", "organizationLogo": "./static/Microsoft-logo_rgb_c-gray-square.png",
"organizationWideLogo": "./static/Microsoft-logo_rgb_c-white.png", "organizationWideLogo": "./static/Microsoft-logo_rgb_c-white.png",
"browserSupport": [
{
"name": "unsupported",
"os": "*",
"path": "/browsers"
},
{
"name": "unsupported",
"os": "mac",
"path": "/browsers/mac"
},
{
"name": "unsupported",
"os": "linux",
"path": "browsers/linux"
},
{
"name": "unsupported",
"os": "rpi",
"path": "/raspberry-pi"
},
{
"name": "unsupported",
"os": "windows",
"path": "/browsers/windows"
}
],
"boardName": "Calliope mini", "boardName": "Calliope mini",
"driveDisplayName": "MINI",
"hideSideDocs": true, "hideSideDocs": true,
"invertedMenu": true, "invertedMenu": true,
"invertedToolbox": true, "invertedToolbox": true,
"monacoToolbox": false, "monacoToolbox": false,
"hasAudio": true, "hasAudio": true,
"highContrast": true,
"simAnimationEnter": "rotate in", "simAnimationEnter": "rotate in",
"simAnimationExit": "rotate out", "simAnimationExit": "rotate out",
"blocklyOptions": { "blocklyOptions": {
@ -250,6 +215,8 @@
"snap": false "snap": false
} }
}, },
"docMenu": [] "docMenu": [],
} "hasReferenceDocs": false
},
"ignoreDocsErrors": true
} }

View File

@ -98,7 +98,7 @@ namespace pxsim {
break; break;
case "radiopacket": case "radiopacket":
let packet = <SimulatorRadioPacketMessage>msg; let packet = <SimulatorRadioPacketMessage>msg;
this.radioState.recievePacket(packet); this.radioState.receivePacket(packet);
break; break;
} }
} }

View File

@ -4,7 +4,7 @@ namespace pxsim {
if (b) { if (b) {
let np = b.neopixelState; let np = b.neopixelState;
if (np) { if (np) {
let buf = <Uint8Array[]>(<any>buffer).data; let buf = <Uint8Array>(<any>buffer).data;
np.updateBuffer(buf, pin); np.updateBuffer(buf, pin);
runtime.queueDisplayUpdate(); runtime.queueDisplayUpdate();
} }

View File

@ -21,11 +21,12 @@ namespace pxsim {
} }
send(payload: SimulatorRadioPacketPayload) { send(payload: SimulatorRadioPacketPayload) {
const b = board();
Runtime.postMessage(<SimulatorRadioPacketMessage>{ Runtime.postMessage(<SimulatorRadioPacketMessage>{
type: "radiopacket", type: "radiopacket",
rssi: 0, // Not yet supported rssi: 70, // Not yet supported
serial: board().radioState.bus.transmitSerialNumber ? board().radioState.bus.serial : 0, serial: b.radioState.bus.transmitSerialNumber ? pxsim.control.deviceSerialNumber() : 0,
time: 0, // Not yet supported time: new Date().getTime(),
payload payload
}) })
} }
@ -41,26 +42,19 @@ namespace pxsim {
rssi: -1, rssi: -1,
serial: 0, serial: 0,
time: 0, time: 0,
payload: { type: -1 } payload: { type: -1, groupId: 0 }
}; };
} }
} }
export class RadioBus { export class RadioBus {
// uint8_t radioDefaultGroup = MICROBIT_RADIO_DEFAULT_GROUP; // uint8_t radioDefaultGroup = MICROBIT_RADIO_DEFAULT_GROUP;
groupId = 0; // todo
power = 0; power = 0;
serial = 0;
transmitSerialNumber = false; transmitSerialNumber = false;
datagram: RadioDatagram; datagram: RadioDatagram;
constructor(private runtime: Runtime) { constructor(private runtime: Runtime) {
this.datagram = new RadioDatagram(runtime); this.datagram = new RadioDatagram(runtime);
this.serial = Math.floor(Math.random() * Math.pow(2, 32)) - Math.pow(2, 31); // 32 bit signed integer
}
setGroup(id: number) {
this.groupId = id & 0xff; // byte only
} }
setTransmitPower(power: number) { setTransmitPower(power: number) {
@ -71,26 +65,37 @@ namespace pxsim {
this.transmitSerialNumber = !!sn; this.transmitSerialNumber = !!sn;
} }
broadcast(msg: number) { broadcast(msg: number, groupId: number) {
Runtime.postMessage(<SimulatorEventBusMessage>{ Runtime.postMessage(<SimulatorEventBusMessage>{
type: "eventbus", type: "eventbus",
id: DAL.MES_BROADCAST_GENERAL_ID, id: DAL.MES_BROADCAST_GENERAL_ID,
eventid: msg, eventid: msg,
power: this.power, power: this.power,
group: this.groupId group: groupId
}) })
} }
} }
export class RadioState { export class RadioState {
bus: RadioBus; bus: RadioBus;
groupId: number;
constructor(runtime: Runtime) { constructor(runtime: Runtime) {
this.bus = new RadioBus(runtime); this.bus = new RadioBus(runtime);
this.groupId = 0;
} }
public recievePacket(packet: SimulatorRadioPacketMessage) { public setGroup(id: number) {
this.bus.datagram.queue(packet) this.groupId = id & 0xff; // byte only
}
public broadcast(msg: number) {
this.bus.broadcast(msg, this.groupId)
}
public receivePacket(packet: SimulatorRadioPacketMessage) {
if (this.groupId == packet.payload.groupId)
this.bus.datagram.queue(packet)
} }
} }
} }
@ -103,7 +108,7 @@ namespace pxsim.radio {
} }
export function broadcastMessage(msg: number): void { export function broadcastMessage(msg: number): void {
board().radioState.bus.broadcast(msg); board().radioState.broadcast(msg);
} }
export function onBroadcastMessageReceived(msg: number, handler: RefAction): void { export function onBroadcastMessageReceived(msg: number, handler: RefAction): void {
@ -111,7 +116,7 @@ namespace pxsim.radio {
} }
export function setGroup(id: number): void { export function setGroup(id: number): void {
board().radioState.bus.setGroup(id); board().radioState.setGroup(id);
} }
export function setTransmitPower(power: number): void { export function setTransmitPower(power: number): void {
@ -125,7 +130,8 @@ namespace pxsim.radio {
export function sendNumber(value: number): void { export function sendNumber(value: number): void {
board().radioState.bus.datagram.send({ board().radioState.bus.datagram.send({
type: PacketPayloadType.NUMBER, type: PacketPayloadType.NUMBER,
numberData: value groupId: board().radioState.groupId,
numberData: value,
}); });
} }
@ -133,7 +139,8 @@ namespace pxsim.radio {
msg = msg.substr(0, 19); msg = msg.substr(0, 19);
board().radioState.bus.datagram.send({ board().radioState.bus.datagram.send({
type: PacketPayloadType.STRING, type: PacketPayloadType.STRING,
stringData: msg groupId: board().radioState.groupId,
stringData: msg,
}); });
} }
@ -153,6 +160,7 @@ namespace pxsim.radio {
msg.push() msg.push()
board().radioState.bus.datagram.send({ board().radioState.bus.datagram.send({
type: PacketPayloadType.VALUE, type: PacketPayloadType.VALUE,
groupId: board().radioState.groupId,
stringData: name, stringData: name,
numberData: value numberData: value
}); });
@ -186,7 +194,7 @@ namespace pxsim.radio {
} }
export function receivedString(): string { export function receivedString(): string {
return board().radioState.bus.datagram.lastReceived.payload.stringData || ""; return initString(board().radioState.bus.datagram.lastReceived.payload.stringData || "");
} }
export function receivedTime(): number { export function receivedTime(): number {

View File

@ -7,7 +7,17 @@
"ubirch" "ubirch"
], ],
"approvedRepos": [ "approvedRepos": [
"CoderDojoOlney/pxt-olney" "CoderDojoOlney/pxt-olney",
"Tinkertanker/pxt-ssd1306-microbit"
],
"preferredRepos": [
"calliope-mini/pxt-calliope-modem",
"calliope-mini/pxt-calliope-bc95",
"calliope-mini/pxt-calliope-esp",
"calliope-mini/pxt-calliope-bunt",
"calliope-mini/pxt-isl29125",
"ubirch/pxt-ubirch",
"Tinkertanker/pxt-ssd1306-microbit"
] ]
} }
} }

73
theme/blockly.less Normal file
View File

@ -0,0 +1,73 @@
@import 'themes/default/globals/site.variables';
@import 'themes/pxt/globals/site.variables';
@import 'site/globals/site.variables';
@import 'blockly-core';
/* Reference import */
@import (reference) "semantic.less";
/*******************************
Blockly
*******************************/
div.blocklyTreeRow {
box-shadow: inset 0 -1px 0 0 #ecf0f1;
margin-bottom: 0px !important;
-webkit-transition-property: background-color; /* Safari */
-webkit-transition-duration: 1s; /* Safari */
transition-property: background-color;
transition-duration: 1s;
}
/* Blockly toolbox font size same as the page font */
span.blocklyTreeLabel {
font-family: @pageFont !important;
font-weight: 200;
}
.blocklyToolboxDiv, .monacoToolboxDiv {
background-color: white !important;
border-left: 1px solid #ecf0f1 !important;
box-shadow: 4px 0px 2px -4px rgba(0,0,0,0.12), 4px 0px 2px -4px rgba(0,0,0,0.24);
}
.blocklyFlyoutBackground {
fill: #525A67 !important;
}
/* Remove shadow around blockly blocks */
.blocklyPathDark, .blocklyPathLight {
display: none;
}
/* Blockly Field: Grid picker */
.blocklyGridPickerTooltip {
padding: 3px 5px;
background-color: #fefefe;
border: black solid 3px;
color: black;
border-radius: 10px;
}
/* Mobile */
@media only screen and (max-width: @largestMobileScreen) {
.blocklyToolboxDiv, .monacoToolboxDiv {
border-left: 0 !important;
}
div.blocklyTreeRoot {
padding: 0;
}
}
/* Tablet */
@media only screen and (min-width: @tabletBreakpoint) and (max-width: @largestTabletScreen) {
.blocklyToolboxDiv, .monacoToolboxDiv {
border-left: 0 !important;
}
div.blocklyTreeRoot {
padding: 0;
}
}