pxt-calliope/target.js

402 lines
455 KiB
JavaScript
Raw Normal View History

2017-08-19 17:16:35 +02:00
var pxtTargetBundle = {
"id": "calliope",
"name": " calliope",
"nickname": "mini",
"title": "calliope mini - Blocks / Javascript editor",
"description": "A Blocks / JavaScript code editor for the calliope mini.",
"corepkg": "core",
"bundleddirs": [
"libs/core",
"libs/radio",
"libs/devices",
"libs/bluetooth",
"libs/pxt-calliope-bc95",
"libs/pxt-calliope-bunt"
],
"cloud": {
"workspace": false,
"packages": true,
"sharing": true,
"publishing": true,
"preferredPackages": [],
"githubPackages": true
},
"compile": {
"isNative": true,
"hasHex": true,
"deployDrives": "MINI",
"driveName": "MINI",
"hexMimeType": "application/x-calliope-hex",
"upgrades": [
{
"type": "package",
"map": {
"microbit": "core",
"microbit-bluetooth": "bluetooth",
"microbit-radio": "radio",
"microbit-devices": "devices",
"microbit-led": "",
"microbit-music": "",
"microbit-game": "",
"microbit-pins": "",
"microbit-serial": ""
}
},
{
"type": "api",
"map": {
"bluetooth\\.uartRead\\((.*?)\\)": "bluetooth.uartReadUntil($1)",
"bluetooth\\.uartWrite\\((.*?)\\)": "bluetooth.uartWriteUntil($1)"
}
}
],
"jsRefCounting": true
},
"runtime": {
"mathBlocks": true,
"loopsBlocks": true,
"logicBlocks": true,
"variablesBlocks": true,
"textBlocks": true,
"onStartColor": "#54C9C9",
"onStartNamespace": "basic"
},
"simulator": {
"autoRun": true,
"streams": true,
"aspectRatio": 1.13,
"parts": false,
"partsAspectRatio": 0.69,
"boardDefinition": {
"visual": "calliope",
"gpioPinBlocks": [
[
"EDGE_P0"
],
[
"EDGE_P1"
],
[
"EDGE_P2"
],
[
"EDGE_P3"
],
[
"C_P4",
"C_P5",
"C_P6",
"C_P7"
],
[
"C_P8",
"C_P9",
"C_P10",
"C_P11",
"C_P12"
],
[
"C_P16"
]
],
"gpioPinMap": {
"P0": "EDGE_P0",
"P1": "EDGE_P1",
"P2": "EDGE_P2",
"P3": "EDGE_P3",
"C4": "C_P4",
"C5": "C_P5",
"C6": "C_P6",
"C7": "C_P7",
"C8": "C_P8",
"C9": "C_P9",
"C10": "C_P10",
"C11": "C_P11",
"C12": "C_P12",
"C13": "C_P13",
"C14": "C_P14",
"C15": "C_P15",
"C19": "C_P19",
"C20": "C_P20",
"EXT_PWR": "EXT_PWR",
"SPKR": "SPKR",
"BTN_A": "BTN_A",
"BTN_B": "BTN_B",
"MOTOR1": "M_OUT1",
"MOTOR2": "M_OUT2"
},
"spiPins": {
"MOSI": "C_P15",
"MISO": "C_P14",
"SCK": "C_P13"
},
"i2cPins": {
"SDA": "C_P20",
"SCL": "C_P19"
},
"analogInPins": [
"P1",
"P2",
"C4",
"C5",
"C6"
],
"groundPins": [
"EDGE_GND"
],
"threeVoltPins": [
"EDGE_VCC"
],
"attachPowerOnRight": true,
"onboardComponents": [
"accelerometer",
"buttonpair",
"ledmatrix",
"speaker",
"bluetooth",
"thermometer",
"compass",
"speaker",
"microphone",
"rgbled"
],
"useCrocClips": true,
"marginWhenBreadboarding": [
0,
0,
80,
0
]
}
},
"compileService": {
"yottaTarget": "calliope-mini-classic-gcc",
"yottaCorePackage": "microbit",
"githubCorePackage": "calliope-mini/microbit",
"gittag": "v2.0.0-rc8-calliope-1.0.3",
"serviceId": "calliope",
"yottaBinary": "pxt-microbit-app-combined.hex"
},
"serial": {
"manufacturerFilter": "^mbed$",
"nameFilter": "^mbed Serial Port",
"log": true
},
"appTheme": {
"accentColor": "#249899",
"defaultLocale": "de",
"logoUrl": "/pxt-calliope/",
"logo": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTc5LjkiIGhlaWdodD0iMzIuNCIgdmlld0JveD0iMCAwIDE3OS45IDMyLjQiPgogIDxwYXRoIGZpbGw9IiM0OTUyNjAiIGQ9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jx1c2UKICAgICAgICAgICB4bGluazpocmVmPSIjU1ZHSURfN18iCiAgICAgICAgICAgb3ZlcmZsb3c9InZpc2libGUiCiAgICAgICAgICAgaWQ9InVzZTQ5NjMiCiAgICAgICAgICAgc3R5bGU9Im92ZXJmbG93OnZpc2libGUiCiAgICAgICAgICAgeD0iMCIKICAgICAgICAgICB5PSIwIgogICAgICAgICAgIHdpZHRoPSIxMDAlIgogICAgICAgICAgIGhlaWdodD0iMTAwJSIgLz48L2NsaXBQYXRoPjwvZz48ZwogICAgICAgaWQ9Imc0OTY1Ij48ZGVmcwogICAgICAgICBpZD0iZGVmczQ5NjciPjxyZWN0CiAgICAgICAgICAgaWQ9IlNWR0lEXzlfIgogICAgICAgICAgIHg9IjE5My4xMDAwMSIKICAgICAgICAgICB5PSIyMDQuMTAwMDEiCiAgICAgICAgICAgd2lkdGg9IjMxOC4yOTk5OSIKICAgICAgICAgICBoZWlnaHQ9IjI1Ni4yOTk5OSIgLz48L2RlZnM+PGNsaXBQYXRoCiAgICAgICAgIGlkPSJTVkdJRF8yXyI+PHVzZQogICAgICAgICAgIHhsaW5rOmhyZWY9IiNTVkdJRF85XyIKICAgICAgICAgICBvdmVyZmxvdz0idmlzaWJsZSIKICAgICAgICAgICBpZD0idXNlNDk3MSIKICAgICAgICAgICBzdHlsZT0ib3ZlcmZsb3c6dmlzaWJsZSIKICAgICAgICAgICB4PSIwIgogICAgICAgICAgIHk9IjAiCiAgICAgICAgICAgd2lkdGg9IjEwMCUiCiAgICAgICAgICAgaGVpZ2h0PSIxMDAlIiAvPjwvY2xpcFBhdGg+PC9nPjxnCiAgICAgICBpZD0iZzQ5NzMiPjxkZWZzCiAgICAgICAgIGlkPSJkZWZzNDk3NSI+PHJlY3QKICAgICAgICAgICBpZD0iU1ZHSURfMTFfIgogICAgICAgICAgIHg9IjE5My4xMDAwMSIKICAgICAgICAgICB5PSIyMDQuMTAwMDEiCiAgICAgICAgICAgd2lkdGg9IjMxOC4yOTk5OSIKICA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G93LWhlaWdodD0iMTEzNyIKICAgICBpZD0ibmFtZWR2aWV3NTAwNyIKICAgICBzaG93Z3JpZD0iZmFsc2UiCiAgICAgaW5rc2NhcGU6em9vbT0iMC4zNDIwODMzNyIKICAgICBpbmtzY2FwZTpjeD0iNDIwLjk1MDAxIgogICAgIGlua3NjYXBlOmN5PSIyOTcuNjQ5OTkiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9Ii04IgogICAgIGlua3NjYXBlOndpbmRvdy15PSIxNTYiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJFYmVuZV8xIiAvPjxnCiAgICAgaWQ9Imc0OTU1IgogICAgIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNjAuOTAwMjUsLTIwNC4xKSI+PGcKICAgICAgIGlkPSJnNDk1NyI+PGRlZnMKICAgICAgICAgaWQ9ImRlZnM0OTU5Ij48cmVjdAogICAgICAgICAgIGlkPSJTVkdJRF83XyIKICAgICAgICAgICB4PSIxOTMuMTAwMDEiCiAgICAgICAgICAgeT0iMjA0LjEwMDAxIgogICAgICAgICAgIHdpZHRoPSIzMTguMjk5OTkiCiAgICAgICAgICAgaGVpZ2h0PSIyNTYuMjk5OTkiIC8+PC9kZWZzPjxjbGlwUGF0aAogICAgICAgICBpZD0iU1ZHSURfMV8iPjx1c2UKICAgICAgICAgICB4bGluazpocmVmPSIjU1ZHSURfN18iCiAgICAgICAgICAgb3ZlcmZsb3c9InZpc2libGUiCiAgICAgICAgICAgaWQ9InVzZTQ5NjMiCiAgICAgICAgICAgc3R5bGU9Im92ZXJmbG93OnZpc2libGUiCiAgICAgICAgICAgeD0iMCIKICAgICAgICAgICB5PSIwIgogICAgICAgICAgIHdpZHRoPSIxMDAlIgogICAgICAgICAgIGhlaWdodD0iMTAwJSIgLz48L2NsaXBQYXRoPjwvZz48ZwogICAgICAgaWQ9Imc0OTY1Ij48ZGVmcwogICAgICAgICBpZD0iZGVmczQ5NjciPjxyZWN0CiAgICAgICAgICAgaWQ9IlNWR0lEXzlfIgogICAgICAgICAgIHg9IjE5My4xMDAwMSIKICAgICAgICAgICB5PSIyMDQuMTAwMDEiCiAgICAgICAgICAgd2lkdGg9IjMxOC4yOTk5OSIKICAgICAgICAgICBoZWlnaHQ9IjI1Ni4yOTk5OSIgLz48L2RlZnM+PGNsaXBQYXRoCiAgICAgICAgIGlkPSJTVkdJRF8yXyI+PHVzZQogICAgICAgICAgIHhsaW5rOmhyZWY9IiNTVkdJRF85XyIKICAgICAgICAgICBvdmVyZmxvdz0idmlzaWJsZSIKICAgICAgICAgICBpZD0idXNlNDk3MSIKICAgICAgICAgICBzdHlsZT0ib3ZlcmZsb3c6dmlzaWJsZSIKICAgICAgICAgICB4PSIwIgogICAgICAgICAgIHk9IjAiCiAgICAgICAgICAgd2lkdGg9IjEwMCUiCiAgICAgICAgICAgaGVpZ2h0PSIxMDAlIiAvPjwvY2xpcFBhdGg+PC9nPjxnCiAgICAgICBpZD0iZzQ5NzMiPjxkZWZzCiAgICAgICAgIGlkPSJkZWZzNDk3NSI+PHJlY3QKICAgICAgICAgICBpZD0iU1ZHSURfMTFfIgogICAgICAgICAgIHg9IjE5My4xMDAwMSIKICAgICAgICAgICB5PSIyMDQuMTAwMDEiCiAgICAgICAgICAgd2lkdGg9IjMxOC4yOTk5OSIKICAgICAgICAgICBoZWlnaHQ9IjI1Ni4yOTk5OSIgLz48L2RlZnM+PGNsaXBQYXRoCiAgICAgICAgIGlkPSJTVkdJRF8zXyI+PHVzZQogICAgICAgICAgIHhsaW5rOmhyZWY9IiNTVkdJRF8xMV8iCiAgICAgICAgICAgb3ZlcmZsb3c9InZpc2libGUiCiAgICAgICAgICAgaWQ9InVzZTQ5NzkiCiAgICAgICAgICAgc3R5bGU9Im92ZXJmbG93OnZpc2libGUiCiAgICAgICAgICAgeD0i
"footerLogo": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiB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kzDMeAFAtV6SMaEtkbAOLgwAsuZKHvpTaUdeVLKPHbAAAABJe0DyhpXAZw6EQW3dyzTzjAQClfLEoFUyuzlXYwOIoIrm4577z9/9OMdZH1jvxjyKM6jEbAABAGJYKNc+CGh8gnsC6ExMUccA044GIUlaqlKyOjG1UcVwplf7PfOrUtr03BbjqwTHkSMQfXt9sAMD1STiGBwTq7QCXrplSQsjDffFBnynGg2qamMmpiqWbYm88cWiIb
"homeUrl": "/pxt-calliope/",
"embedUrl": "https://mini.pxt.io/",
"privacyUrl": "https://go.microsoft.com/fwlink/?LinkId=521839",
"termsOfUseUrl": "https://go.microsoft.com/fwlink/?LinkID=206977",
"githubUrl": "https://github.com/Microsoft/pxt-calliope",
"crowdinProject": "kindscript",
"organization": "Microsoft MakeCode",
"organizationUrl": "https://makecode.com/",
"organizationLogo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAS0AAAEtCAMAAABqPcbcAAAABGdBTUEAALGPC/xhBQAAAwBQTFRFAAAAf7oAAKTvP7ryb8v18lAi9XtYnss/tthv/7kA/8o//9dv95yCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApRt6LQAAAQB0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AFP3ByUAAAAJcEhZcwAALiEAAC4hAQdb/P8AAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTJDBGvsAAACn0lEQVR4Xu3QsVUDMRQAQYHB5gz9tyuSX8BtpmCmgn27Nvet/X2U53SN18dR3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq1n4e5W82jZ/XUdZkcYdbhVuFW4VbhVuFW4VbhVuFW4VbhVuFW4VbxdqPo3xN1/h9H2Xtz6M8ZtN4X0dxq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcKtwq3CrcOu+6/oHGlSc5B6nYrEAAAAASUVORK5CYII=",
"organizationWideLogo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABmcAAAFeCAMAAABHKDtZAAAAdVBMVEUAAADyUCKAugGAugHyUCLyUCKAugGAugGAugH///////////////////////////////////////////////////////////+AugHyUCICpO8CpO8CpO8CpO//uQL/uQL/uQL/uQLyUCKAugH///8CpO//uQLk57r3AAAAInRSTlMAv4BAj4Cfr78wQFCAcBAgYL/fz6/vj58gQL+An2BAgL8wO9ga1QAAAAFiS0dECfHZpewAAAAJcEhZcwAAAJYAAACWAHFG/vAAAC7SSURBVHja7Z2Ldus8kl6dnkwmkiiJkigp6U7mFifv/4iR7WP/upDEV0ABIOm915pevaaPSZACsYFCAXj7z1nwX96e+Nv/mQX/9AYA8NupbRA8AwCwbGobBM8AACyb2gbBMwAAy6a2QfAMAMCyqW0QPAMAsGxqG0Tj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C+Cg1uZJema3uUiNyzeni38b88J+O/Q+D9vIH3f1rK0Q525bxDWbq360Ub4yGWvBzfpX33qAZ/BMCUTPlM8ECLYCrVqbw5/JV5DoI3DRw+Xrf0vs0z+waoytyxeni9DarUee5c//NPAs6y65TXhkt7nGbVB3a0wd33YPm85cpvO1dRb9fmsvxVc9sEv/q1b0VGzpAzpEoPzyh5HP7hs885s8UzwTIBg3PqvFFzzj1vdS2F8Szgg9BlWjdFD7nmVztP/NKBFt+f3Pe802qtlfYrdnjR7V9RRiG9XV+Oa0tUnP4/jzOuCZrPyPXF/ZE6pn
"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",
"hideSideDocs": true,
"invertedMenu": true,
"invertedToolbox": true,
"monacoToolbox": false,
"hasAudio": true,
"simAnimationEnter": "rotate in",
"simAnimationExit": "rotate out",
"blocklyOptions": {
"grid": {
"spacing": 45,
"length": 7,
"colour": "rgba(189, 195, 199, 0.30)",
"snap": false
}
},
"docMenu": [],
"id": "calliope",
"title": "calliope mini - Blocks / Javascript editor",
"name": " calliope",
"description": "A Blocks / JavaScript code editor for the calliope mini.",
"htmlDocIncludes": {},
"locales": {}
},
"blocksprj": {
"id": "blocksprj",
"config": {
"name": "{0} block",
"dependencies": {
"core": "*",
"radio": "*"
},
"description": "",
"files": [
"main.blocks",
"main.ts",
"README.md"
]
},
"files": {
"README.md": "",
"main.blocks": "<xml xmlns=\"http://www.w3.org/1999/xhtml\">\n<block type=\"device_forever\">\n<statement name=\"HANDLER\">\n<block type=\"device_show_leds\">\n<field name=\"LED00\">FALSE</field>\n<field name=\"LED10\">FALSE</field>\n<field name=\"LED20\">FALSE</field>\n<field name=\"LED30\">FALSE</field>\n<field name=\"LED40\">FALSE</field>\n<field name=\"LED01\">FALSE</field>\n<field name=\"LED11\">TRUE</field>\n<field name=\"LED21\">FALSE</field>\n<field name=\"LED31\">TRUE</field>\n<field name=\"LED41\">FALSE</field>\n<field name=\"LED02\">FALSE</field>\n<field name=\"LED12\">FALSE</field>\n<field name=\"LED22\">FALSE</field>\n<field name=\"LED32\">FALSE</field>\n<field name=\"LED42\">FALSE</field>\n<field name=\"LED03\">TRUE</field>\n<field name=\"LED13\">FALSE</field>\n<field name=\"LED23\">FALSE</field>\n<field name=\"LED33\">FALSE</field>\n<field name=\"LED43\">TRUE</field>\n<field name=\"LED04\">FALSE</field>\n<field name=\"LED14\">TRUE</field>\n<field name=\"LED24\">TRUE</field>\n<field name=\"LED34\">TRUE</field>\n<field name=\"LED44\">FALSE</field>\n<next>\n<block type=\"device_show_leds\">\n<field name=\"LED00\">FALSE</field>\n<field name=\"LED10\">FALSE</field>\n<field name=\"LED20\">FALSE</field>\n<field name=\"LED30\">FALSE</field>\n<field name=\"LED40\">FALSE</field>\n<field name=\"LED01\">FALSE</field>\n<field name=\"LED11\">FALSE</field>\n<field name=\"LED21\">FALSE</field>\n<field name=\"LED31\">FALSE</field>\n<field name=\"LED41\">FALSE</field>\n<field name=\"LED02\">FALSE</field>\n<field name=\"LED12\">FALSE</field>\n<field name=\"LED22\">FALSE</field>\n<field name=\"LED32\">FALSE</field>\n<field name=\"LED42\">FALSE</field>\n<field name=\"LED03\">FALSE</field>\n<field name=\"LED13\">FALSE</field>\n<field name=\"LED23\">FALSE</field>\n<field name=\"LED33\">FALSE</field>\n<field name=\"LED43\">FALSE</field>\n<field name=\"LED04\">FALSE</field>\n<field name=\"LED14\">FALSE</field>\n<field name=\"LED24\">FALSE</field>\n<field name=\"LED34\">FALSE</field>\n<field name=\"LED44\">FALSE</field>\n</block>\n</next>\n</block>\n</statement>\n</block>\n</xml>",
"main.ts": "basic.forever(() => {\n basic.showLeds(`\n . # . # .\n # . # . #\n # . . . #\n . # . # .\n . . # . .\n `)\n basic.showLeds(`\n . . . . .\n . . . . .\n . . . . .\n . . . . .\n . . . . .\n `)\n})"
}
},
"tsprj": {
"id": "tsprj",
"config": {
"name": "{0} bit",
"dependencies": {
"core": "*",
"radio": "*"
},
"description": "",
"files": [
"main.ts",
"README.md"
]
},
"files": {
"README.md": "",
"main.ts": "basic.showLeds(`\n . . . . .\n . # . # .\n . . . . .\n # . . . #\n . # # # .\n `);"
}
},
"bundledpkgs": {
"core": {
"ManagedBuffer.cpp": "#include \"MicroBit.h\"\n#include \"ManagedBuffer.h\"\n#include <limits.h>\n\nstatic const char empty[] __attribute__ ((aligned (4))) = \"\\xff\\xff\\0\\0\\0\";\n\n/**\n * Internal constructor helper.\n * Configures this ManagedBuffer to refer to the static empty buffer.\n */\nvoid ManagedBuffer::initEmpty()\n{\n ptr = (BufferData*)(void*)empty;\n}\n\n/**\n * Default Constructor. \n * Creates an empty ManagedBuffer. \n *\n * Example:\n * @code\n * ManagedBuffer p(); \n * @endcode\n */\nManagedBuffer::ManagedBuffer()\n{\n initEmpty();\n}\n\n/**\n * Constructor. \n * Creates an empty ManagedBuffer of the given size. \n *\n * @param length The length of the buffer to create.\n *\n * Example:\n * @code\n * ManagedBuffer p(16); // Creates a ManagedBuffer 16 bytes long.\n * @endcode\n */\nManagedBuffer::ManagedBuffer(int length)\n{\n this->init(NULL, length);\n}\n\n/**\n * Constructor. \n * Creates a new ManagedBuffer of the given size,\n * and fills it with the data provided.\n *\n * @param data The data with which to fill the buffer.\n * @param length The length of the buffer to create.\n * \n * Example:\n * @code\n * uint8_t buf = {13,5,2};\n * ManagedBuffer p(buf, 3); // Creates a ManagedBuffer 3 bytes long.\n * @endcode\n */\nManagedBuffer::ManagedBuffer(uint8_t *data, int length)\n{\n this->init(data, length);\n}\n\n/**\n * Copy Constructor. \n * Add ourselves as a reference to an existing ManagedBuffer.\n * \n * @param buffer The ManagedBuffer to reference.\n *\n * Example:\n * @code\n * ManagedBuffer p();\n * ManagedBuffer p2(i); // Refers to the same buffer as p. \n * @endcode\n */\nManagedBuffer::ManagedBuffer(const ManagedBuffer &buffer)\n{\n ptr = buffer.ptr;\n ptr->incr();\n}\n\n/**\n * Constructor. \n * Create a buffer from a raw BufferData pointer. It will ptr->incr(). This is to be used by specialized runtimes.\n *\n * @param p The pointer to use.\n */ \nManagedBuffer::ManagedBuffer(BufferData *p)\n{\n ptr = p;\n ptr->incr();\n}\n\n/**\n * Internal constructor-initialiser.\n *\n * @param data The data with which to fill the buffer.\n * @param length The length of the buffer to create.\n * \n */\nvoid ManagedBuffer::init(uint8_t *data, int length)\n{\n if (length <= 0) {\n initEmpty();\n return;\n }\n\n ptr = (BufferData *) malloc(sizeof(BufferData) + length);\n ptr->init();\n\n ptr->length = length;\n\n // Copy in the data buffer, if provided.\n if (data)\n memcpy(ptr->payload, data, length);\n else\n memset(ptr->payload, 0, length);\n}\n\n/**\n * Destructor. \n * Removes buffer resources held by the instance.\n */\nManagedBuffer::~ManagedBuffer()\n{\n ptr->decr();\n}\n\n/**\n * Copy assign operation. \n *\n * Called when one ManagedBuffer is assigned the value of another using the '=' operator.\n * Decrements our reference count and free up the buffer as necessary.\n * Then, update our buffer to refer to that of the supplied ManagedBuffer,\n * and increase its reference count.\n *\n * @param p The ManagedBuffer to reference.\n * \n * Example:\n * @code\n * uint8_t buf = {13,5,2};\n * ManagedBuffer p1(16); \n * ManagedBuffer p2(buf, 3); \n *\n * p1 = p2; \n * @endcode\n */\nManagedBuffer& ManagedBuffer::operator = (const ManagedBuffer &p)\n{\n if(ptr == p.ptr)\n return *this;\n\n ptr->decr();\n ptr = p.ptr;\n ptr->incr();\n\n return *this;\n}\n\n/**\n * Equality operation.\n *\n * Called when one ManagedBuffer is tested to be equal to another using the '==' operator.\n *\n * @param p The ManagedBuffer to test ourselves against.\n * @return true if this ManagedBuffer is identical to the one supplied, false otherwise.\n * \n * Example:\n * @code\n *\n * uint8_t buf = {13,5,2};\n * ManagedBuffer p1(16); \n * ManagedBuffer p2(buf, 3); \n *\n * if(p1 == p2) // will be true\n * uBit.display.scroll(\"same!\");\n * @endcode\n */\nbool ManagedBuffer::operator== (const ManagedBuffer& p)\n{\n if (ptr == p.ptr)\n r
"ManagedBuffer.h": "#ifndef MICROBIT_MANAGED_BUFFER_H\n#define MICROBIT_MANAGED_BUFFER_H\n\n#include \"mbed.h\"\n#include \"RefCounted.h\"\n\nstruct BufferData : RefCounted\n{\n uint16_t length; // The length of the payload in bytes\n uint8_t payload[0]; // ManagedBuffer data\n};\n\n/**\n * Class definition for a ManagedBuffer.\n * A ManagedBuffer holds a series of bytes, used with MicroBitRadio channels and in other places.\n * n.b. This is a mutable, managed type.\n */\nclass ManagedBuffer\n{\n BufferData *ptr; // Pointer to payload data\n \n public:\n\n /**\n * Default Constructor. \n * Creates an empty ManagedBuffer. The 'ptr' field in all empty buffers is shared.\n *\n * Example:\n * @code\n * ManagedBuffer p(); \n * @endcode\n */\n ManagedBuffer();\n\n /**\n * Constructor. \n * Creates a new ManagedBuffer of the given size. \n *\n * @param length The length of the buffer to create.\n *\n * Example:\n * @code\n * ManagedBuffer p(16); // Creates a ManagedBuffer 16 bytes long.\n * @endcode\n */\n ManagedBuffer(int length);\n\n /**\n * Constructor. \n * Creates an empty ManagedBuffer of the given size,\n * and fills it with the data provided.\n *\n * @param data The data with which to fill the buffer.\n * @param length The length of the buffer to create.\n * \n * Example:\n * @code\n * uint8_t buf[] = {13,5,2};\n * ManagedBuffer p(buf, 3); // Creates a ManagedBuffer 3 bytes long.\n * @endcode\n */\n ManagedBuffer(uint8_t *data, int length);\n\n /**\n * Copy Constructor. \n * Add ourselves as a reference to an existing ManagedBuffer.\n * \n * @param buffer The ManagedBuffer to reference.\n *\n * Example:\n * @code\n * ManagedBuffer p();\n * ManagedBuffer p2(i); // Refers to the same buffer as p. \n * @endcode\n */\n ManagedBuffer(const ManagedBuffer &buffer);\n\n /**\n * Constructor. \n * Create a buffer from a raw BufferData pointer. It will ptr->incr(). This is to be used by specialized runtimes.\n *\n * @param p The pointer to use.\n */ \n ManagedBuffer(BufferData *p);\n\n /**\n * Internal constructor helper.\n * Configures this ManagedBuffer to refer to the static empty buffer.\n */\n void initEmpty();\n\n /**\n * Internal constructor-initialiser.\n *\n * @param data The data with which to fill the buffer.\n * @param length The length of the buffer to create.\n * \n */\n void init(uint8_t *data, int length);\n\n /**\n * Destructor. \n * Removes buffer resources held by the instance.\n */\n ~ManagedBuffer();\n\n /**\n * Provide an array containing the buffer data.\n * @return The contents of this buffer, as an array of bytes.\n */\n uint8_t *getBytes()\n {\n return ptr->payload;\n }\n\n /**\n * Get current ptr, do not decr() it, and set the current instance to an empty buffer.\n * This is to be used by specialized runtimes which pass BufferData around.\n */\n BufferData *leakData();\n\n /**\n * Copy assign operation. \n *\n * Called when one ManagedBuffer is assigned the value of another using the '=' operator.\n * Decrements our reference count and free up the buffer as necessary.\n * Then, update our buffer to refer to that of the supplied ManagedBuffer,\n * and increase its reference count.\n *\n * @param p The ManagedBuffer to reference.\n * \n * Example:\n * @code\n * uint8_t buf = {13,5,2};\n * ManagedBuffer p1(16); \n * ManagedBuffer p2(buf, 3); \n *\n * p1 = p2; \n * @endcode\n */\n ManagedBuffer& operator = (const ManagedBuffer& p);\n\n /**\n * Array access operation (read). \n *\n * Called when a ManagedBuffer
"README.md": "# core\n\nThe core library.\n\n",
"_locales/de/core-jsdoc-strings.json": "{\n \"Math.abs\": \"Gibt den absoluten Wert einer Zahl aus (den Wert unabhängig davon, ob er positiv oder negativ ist).\\nDer absolute Wert von -5 ist zum Beispiel der gleiche wie der von 5.\",\n \"Math.abs|param|x\": \"Ein numerischer Ausdruck, für den der absolute Wert benötigt wird.\",\n \"Math.max\": \"Gibt den größeren von zwei vorhandenen numerischen Ausdrücken aus.\",\n \"Math.min\": \"Gibt den niedrigeren von zwei vorhandenen numerischen Ausdrücken aus.\",\n \"Math.pow\": \"Gibt den Wert eines grundlegenden Ausdrucks bis zu einer bestimmten Stärke aus.\",\n \"Math.pow|param|x\": \"Der Basiswert des Ausdrucks.\",\n \"Math.pow|param|y\": \"Der exponentielle Wert des Ausdrucks.\",\n \"Math.random\": \"Gibt eine pseudozufüllige Zahl zwischen 0 und `max`aus.\",\n \"Math.randomBoolean\": \"Erzeugt zufällig einen \\\"wahr\\\" oder \\\"falsch\\\"-Wert, wie bei einem Münzwurf.\",\n \"Math.sign\": \"Gibt das Vorzeichen von x aus und zeigt an, ob dieses positiv, negativ oder null ist.\",\n \"Math.sign|param|x\": \"Der numerische Ausdruck, der getestet werden soll\",\n \"Math.sqrt\": \"Gibt die Quadratwurzel einer Zahl aus.\",\n \"Math.sqrt|param|x\": \"Ein numerischer Ausdruck.\",\n \"String.charAt\": \"Gibt den Buchstaben beim angegebenen Index aus.\",\n \"String.charAt|param|index\": \"Der null-basierte index des gewünschten Zeichens.\",\n \"String.charCodeAt\": \"Gibt den Unicode-Wert des Zeichens am vorgegebenen Ort aus.\",\n \"String.charCodeAt|param|index\": \"Der null-basierte Index des gewünschten Zeichens. Wenn kein Zeichen am angegeben Index vorhanden ist, wird NaN ausgegeben.\",\n \"String.compare\": \"Bestimmt die relative Reihenfolge zweier Strings (in ASCII).\",\n \"String.compare|param|that\": \"Zeichenfolge, die mit der Zielzeichenfolge verglichen werden soll\",\n \"String.concat\": \"Gibt eine Zeichenfolge aus, die die Verkettung von zwei oder mehr Zeichenfolgen ist.\",\n \"String.concat|param|other\": \"Die Zeichenfolge, die an das Ende einer Zeichenfolge angehängt werden soll.\",\n \"String.fromCharCode\": \"Erstelle Sie eine Zeichenfolge aus dem angegebenen ASCII-Zeichencode.\",\n \"String.isEmpty\": \"Gibt einen Wert aus, der anzeigt, ob die Zeichenfolge leer ist\",\n \"String.length\": \"Gibt die Länge einer Zeichenfolge aus.\",\n \"String.substr\": \"Gibt eine Teilzeichenfolge der aktuellen Zeichenfolge aus.\",\n \"String.substr|param|length\": \"Anzahl der zu extrahierenden Zeichen\",\n \"String.substr|param|start\": \"Erster Zeichenindex, kann beim zählen vom Ende negativ sein, zum Beispiel: 0\",\n \"basic\": \"Bietet Zugriff auf grundlegende mini-Funktionalität.\",\n \"basic.clearScreen\": \"Schalte alle LEDs aus\",\n \"basic.color\": \"Konvertiert den Farbnamen in eine Nummer\",\n \"basic.forever\": \"Wiederholt immer wieder den Code im Hintergrund. Bei jeder Iteration ist es möglich, anderen Code auszuführen.\",\n \"basic.pause\": \"Pausiere für die angegebene Zeit in Millisekunden\",\n \"basic.pause|param|ms\": \"wie lange pausieren, z.B.: 100, 200, 500, 1000, 2000\",\n \"basic.plotLeds\": \"Zeichnet ein Bild auf dem LED-Bildschirm.\",\n \"basic.plotLeds|param|leds\": \"Muster der LEDs, die ein-/ und ausgeschaltet werden\",\n \"basic.rgbw\": \"Konvertiert Rot-, Grün- und Blau-Kanäle in eine RGB-Farbe\",\n \"basic.rgbw|param|blue\": \"Blauwert zwischen 0 und 255, z.B. 255\",\n \"basic.rgbw|param|green\": \"Grünwert zwischen 0 und 255, z.B. 255\",\n \"basic.rgbw|param|red\": \"Rotwert zwischen 0 und 255, z.B. 255\",\n \"basic.rgbw|param|white\": \"Weißwert zwischen 0 und 255, z.B. 0\",\n \"basic.setLedColor\": \"Legt die Farbe der eingebauten LED fest. Setze auf 0, um diese abzuschalten.\",\n \"basic.showAnimation\": \"Zeigt eine Abfolge von LED-Anzeigen als Animation.\",\n \"basic.showAnimation|param|interval\": \"Zeit in Millisekunden zwischen jedem Neuzeichnen\",\n \"basic.showAnimation|param|leds\": \"Muster der LEDs, die ein-/ und ausgeschaltet werden\",\n \"basic.showLeds\": \"
"_locales/de/core-strings.json": "{\n \"AcceleratorRange.EightG\": \"Der Bewegungssensor misst Kräfte bis 8g\",\n \"AcceleratorRange.EightG|block\": \"8g\",\n \"AcceleratorRange.FourG\": \"Der Bewegungssensor misst Kräfte bis 4g\",\n \"AcceleratorRange.FourG|block\": \"4g\",\n \"AcceleratorRange.OneG\": \"Der Bewegungssensor misst Kräfte bis 1g\",\n \"AcceleratorRange.OneG|block\": \"1g\",\n \"AcceleratorRange.TwoG\": \"Der Bewegungssensor misst Kräfte bis 2g\",\n \"AcceleratorRange.TwoG|block\": \"2g\",\n \"BaudRate.BaudRate115200|block\": \"115200\",\n \"BaudRate.BaudRate9600|block\": \"9600\",\n \"BeatFraction.Eighth|block\": \"1/8\",\n \"BeatFraction.Half|block\": \"1/2\",\n \"BeatFraction.Quarter|block\": \"1/4\",\n \"BeatFraction.Sixteenth|block\": \"1/16\",\n \"BeatFraction.Whole|block\": \"1\",\n \"Button.AB|block\": \"A+B\",\n \"Colors.Blue|block\": \"Blau\",\n \"Colors.Green|block\": \"Grün\",\n \"Colors.Indigo|block\": \"Indigo\",\n \"Colors.Orange|block\": \"Orange\",\n \"Colors.Purple|block\": \"Violett\",\n \"Colors.Red|block\": \"Rot\",\n \"Colors.Violet|block\": \"Veilchenblau\",\n \"Colors.White|block\": \"Weiß\",\n \"Colors.Yellow|block\": \"Gelb\",\n \"Delimiters.Dollar|block\": \"$\",\n \"Delimiters.Hash|block\": \"#\",\n \"Delimiters.NewLine|block\": \"Neue Zeile\",\n \"Dimension.Strength|block\": \"Stärke\",\n \"Dimension.X|block\": \"x\",\n \"Dimension.Y|block\": \"y\",\n \"Dimension.Z|block\": \"z\",\n \"Direction.Left|block\": \"links\",\n \"Direction.Right|block\": \"rechts\",\n \"DisplayMode.BackAndWhite|block\": \"Schwarz-Weiß\",\n \"DisplayMode.Greyscale|block\": \"Graustufen\",\n \"EventCreationMode.CreateAndFire\": \"Calliope mini-Event wurde initialisiert, seine Event-Handler werden unverzüglich ausgeführt (nicht geeignet für die Nutzung bei Unterbrechungen!).\",\n \"EventCreationMode.CreateOnly\": \"Calliope mini-Event wurde initialisiert, es wird keine weitere Verarbeitung vorgenommen.\",\n \"Gesture.FreeFall\": \"Wird ausgeführt, wenn das Board fällt!\",\n \"Gesture.FreeFall|block\": \"freier Fall\",\n \"Gesture.LogoDown\": \"Wird ausgeführt, wenn das Logo nach unten zeigt und das Display vertikal ist.\",\n \"Gesture.LogoDown|block\": \"Logo nach unten\",\n \"Gesture.LogoUp\": \"Wird ausgeführt, wenn das Logo nach oben zeigt und das Display vertikal ist.\",\n \"Gesture.LogoUp|block\": \"Logo oben\",\n \"Gesture.ScreenDown\": \"Wird ausgeführt, wenn das Display nach oben zeigt und das Board horizontal ist.\",\n \"Gesture.ScreenDown|block\": \"Display nach unten\",\n \"Gesture.ScreenUp\": \"Wird ausgeführt, wenn das Display nach unten zeigt und das Board horizontal ist.\",\n \"Gesture.ScreenUp|block\": \"Display nach oben\",\n \"Gesture.Shake\": \"Wird erhöht, wenn geschüttelt\",\n \"Gesture.Shake|block\": \"geschüttelt\",\n \"Gesture.SixG\": \"Wird ausgeführt, ein 6g starker Stoß erkannt wird\",\n \"Gesture.SixG|block\": \"6g\",\n \"Gesture.ThreeG\": \"Wird ausgeführt, ein 3g starker Stoß erkannt wird\",\n \"Gesture.ThreeG|block\": \"3g\",\n \"Gesture.TiltLeft\": \"Wird ausgeführt, wenn das Display nach links zeigt\",\n \"Gesture.TiltLeft|block\": \"nach links neigen\",\n \"Gesture.TiltRight\": \"Wird ausgeführt, wenn das Display nach rechts zeigt\",\n \"Gesture.TiltRight|block\": \"nach rechts neigen\",\n \"LedSpriteProperty.Blink|block\": \"blinken\",\n \"LedSpriteProperty.Brightness|block\": \"Helligkeit\",\n \"LedSpriteProperty.Direction|block\": \"Richtung\",\n \"LedSpriteProperty.X|block\": \"x\",\n \"LedSpriteProperty.Y|block\": \"y\",\n \"Math.randomBoolean|block\": \"wähle zufälligen Wahr- oder Falsch-Wert\",\n \"Math|block\": \"Mathematik\",\n \"Motor.AB|block\": \"A und B\",\n \"MotorCommand.Break|block\": \"Pause\",\n \"MotorCommand.Coast|block\": \"auslaufen\",\n \"MotorCommand.Sleep|block\": \"schlafen\",\n \"Note.CSharp3|block\": \"C#3\",\n \"Note.CSharp4|block\": \"C#4\",\n \"Note.CSharp5|block\": \"C#5\",\n \"Note.CSharp|block\": \"C#\",\n \"Note.FSharp3|block\":
"basic.cpp": "#include \"pxt.h\"\n\n\n/**\n * Provides access to basic micro:bit functionality.\n */\n//% color=#54C9C9 weight=100 icon=\"\\uf00a\"\nnamespace basic {\n /**\n * Sets the color on the build-in LED. Set to 0 to turn off.\n */\n //% blockId=device_set_led_color block=\"set led to %color=color_id\"\n //% weight=50\n void setLedColor(int color) {\n if (!color) {\n uBit.rgb.off();\n return;\n }\n\n int w = (color >> 24) & 0xFF;\n int r = (color >> 16) & 0xFF;\n int g = (color >> 8) & 0xFF;\n int b = (color) & 0xFF;\n \n uBit.rgb.setColour(r,g,b,w);\n }\n\n /**\n * Scroll a number on the screen. If the number fits on the screen (i.e. is a single digit), do not scroll.\n * @param interval speed of scroll; eg: 150, 100, 200, -100\n */\n //% help=basic/show-number\n //% weight=96\n //% blockId=device_show_number block=\"show|number %number\" blockGap=8\n //% async\n //% parts=\"ledmatrix\"\n void showNumber(int value, int interval = 150) { \n if (interval < 0)\n return;\n\n ManagedString t(value);\n if (value < 0 || value >= 10) {\n uBit.display.scroll(t, interval);\n } else {\n uBit.display.printChar(t.charAt(0), interval * 5);\n }\n }\n\n /**\n * Draws an image on the LED screen.\n * @param leds the pattern of LED to turn on/off\n * @param interval time in milliseconds to pause after drawing\n */\n //% help=basic/show-leds \n //% weight=95 blockGap=8\n //% imageLiteral=1 async\n //% blockId=device_show_leds\n //% block=\"show leds\"\n //% parts=\"ledmatrix\"\n void showLeds(ImageLiteral leds, int interval = 400) {\n uBit.display.print(MicroBitImage(imageBytes(leds)), 0, 0, 0, interval);\n }\n\n /**\n * Display text on the display, one character at a time. If the string fits on the screen (i.e. is one letter), does not scroll.\n * @param text the text to scroll on the screen, eg: \"Hello!\"\n * @param interval how fast to shift characters; eg: 150, 100, 200, -100\n */\n //% help=basic/show-string \n //% weight=87 blockGap=8\n //% block=\"show|string %text\" \n //% async\n //% blockId=device_print_message\n //% parts=\"ledmatrix\"\n void showString(StringData *text, int interval = 150) {\n if (interval < 0)\n return;\n ManagedString s(text);\n int l = s.length();\n if (l == 0) {\n uBit.display.clear();\n fiber_sleep(interval * 5);\n } else if (l > 1) {\n uBit.display.scroll(s, interval);\n } else {\n uBit.display.print(s.charAt(0), interval * 5);\n }\n }\n\n /**\n * Turn off all LEDs\n */\n //% help=basic/clear-screen weight=79\n //% blockId=device_clear_display block=\"clear screen\"\n //% parts=\"ledmatrix\"\n void clearScreen() {\n uBit.display.image.clear();\n }\n\n /**\n * Shows a sequence of LED screens as an animation.\n * @param leds pattern of LEDs to turn on/off\n * @param interval time in milliseconds between each redraw\n */\n //% help=basic/show-animation imageLiteral=1 async\n //% parts=\"ledmatrix\"\n void showAnimation(ImageLiteral leds, int interval = 400) {\n uBit.display.animate(MicroBitImage(imageBytes(leds)), interval, 5, 0);\n }\n\n /**\n * Draws an image on the LED screen.\n * @param leds pattern of LEDs to turn on/off\n */\n //% help=basic/plot-leds weight=80\n //% parts=\"ledmatrix\"\n void plotLeds(ImageLiteral leds) {\n MicroBitImage i(imageBytes(leds));\n uBit.display.print(i, 0, 0, 0, 0);\n }\n\n void forever_stub(void *a) {\n while (true) {\n runAction0((Action)a);\n fiber_sleep(20);\n }\n }\n\n /**\n * Repeats the code forever in the background. On each iteration, allows other codes to run.\n * @param body code to execute\n */\n //% help=basic/forever weight=55 blockGap=8\n //% blockId=device_forever block=\"forev
"basic.ts": "/**\n Well known colors\n*/\nenum Colors {\n //% blockIdentity=basic.color\n //% block=red\n Red = 0x00FF0000,\n //% blockIdentity=basic.color\n //% block=orange\n Orange = 0x00FFA500,\n //% blockIdentity=basic.color\n //% block=yellow\n Yellow = 0x00FFFF00,\n //% blockIdentity=basic.color\n //% block=green\n Green = 0x0000FF00,\n //% blockIdentity=basic.color\n //% block=blue\n Blue = 0x000000FF,\n //% blockIdentity=basic.color\n //% block=indigo\n Indigo = 0x004b0082,\n //% blockIdentity=basic.color\n //% block=violet\n Violet = 0x008a2be2,\n //% blockIdentity=basic.color\n //% block=purple\n Purple = 0x00FF00FF,\n //% blockIdentity=basic.color\n //% block=white\n White = 0xFF00000\n}\n\n/**\n * Provides access to basic micro:bit functionality.\n */\n//% color=#54C9C9 weight=100\nnamespace basic {\n /**\n * Converts the color name to a number\n */\n //% blockId=color_id block=\"%c\" shim=TD_ID\n export function color(c: Colors): number {\n return c;\n }\n\n /**\n * Converts red, green, blue channels into a RGB color\n * @param red value of the red channel between 0 and 255. eg: 255\n * @param green value of the green channel between 0 and 255. eg: 255\n * @param blue value of the blue channel between 0 and 255. eg: 255\n * @param white value of the white channel between 0 and 255. eg: 0\n */\n //% weight=1\n //% blockId=\"core_rgb\" block=\"red %red|green %green|blue %blue|white %white\"\n export function rgbw(red: number, green: number, blue: number, white:number): number {\n return ((white & 0xFF) << 24) | ((red & 0xFF) << 16) | ((green & 0xFF) << 8) | (blue & 0xFF);\n }\n}",
"buffer.cpp": "#include \"pxt.h\"\n\n// keep in sync with github/pxt/pxtsim/libgeneric.ts\nenum class NumberFormat {\n Int8LE = 1,\n UInt8LE,\n Int16LE,\n UInt16LE,\n Int32LE,\n Int8BE,\n UInt8BE,\n Int16BE,\n UInt16BE,\n Int32BE,\n // UInt32,\n};\n\n//% indexerGet=BufferMethods::getByte indexerSet=BufferMethods::setByte\nnamespace BufferMethods {\n //%\n int getByte(Buffer buf, int off) {\n return max(ManagedBuffer(buf).getByte(off), 0);\n }\n\n //%\n void setByte(Buffer buf, int off, int v) {\n ManagedBuffer(buf).setByte(off, v);\n }\n\n //%\n uint8_t *getBytes(Buffer buf) {\n return buf->payload;\n }\n\n /**\n * Write a number in specified format in the buffer.\n */\n //%\n void setNumber(Buffer buf, NumberFormat format, int offset, int value)\n {\n int8_t i8;\n uint8_t u8;\n int16_t i16;\n uint16_t u16;\n int32_t i32;\n\n ManagedBuffer b(buf);\n\n // Assume little endian\n #define WRITEBYTES(isz, swap) isz = value; b.writeBytes(offset, (uint8_t*)&isz, sizeof(isz), swap); break\n\n switch (format) {\n case NumberFormat::Int8LE: WRITEBYTES(i8, false);\n case NumberFormat::UInt8LE: WRITEBYTES(u8, false);\n case NumberFormat::Int16LE: WRITEBYTES(i16, false);\n case NumberFormat::UInt16LE: WRITEBYTES(u16, false);\n case NumberFormat::Int32LE: WRITEBYTES(i32, false);\n case NumberFormat::Int8BE: WRITEBYTES(i8, true);\n case NumberFormat::UInt8BE: WRITEBYTES(u8, true);\n case NumberFormat::Int16BE: WRITEBYTES(i16, true);\n case NumberFormat::UInt16BE: WRITEBYTES(u16, true);\n case NumberFormat::Int32BE: WRITEBYTES(i32, true);\n }\n }\n\n /**\n * Read a number in specified format from the buffer.\n */\n //%\n int getNumber(Buffer buf, NumberFormat format, int offset)\n {\n int8_t i8;\n uint8_t u8;\n int16_t i16;\n uint16_t u16;\n int32_t i32;\n\n ManagedBuffer b(buf);\n\n // Assume little endian\n #define READBYTES(isz, swap) b.readBytes((uint8_t*)&isz, offset, sizeof(isz), swap); return isz\n\n switch (format) {\n case NumberFormat::Int8LE: READBYTES(i8, false);\n case NumberFormat::UInt8LE: READBYTES(u8, false);\n case NumberFormat::Int16LE: READBYTES(i16, false);\n case NumberFormat::UInt16LE: READBYTES(u16, false);\n case NumberFormat::Int32LE: READBYTES(i32, false);\n case NumberFormat::Int8BE: READBYTES(i8, true);\n case NumberFormat::UInt8BE: READBYTES(u8, true);\n case NumberFormat::Int16BE: READBYTES(i16, true);\n case NumberFormat::UInt16BE: READBYTES(u16, true);\n case NumberFormat::Int32BE: READBYTES(i32, true);\n }\n\n return 0;\n }\n\n /** Returns the length of a Buffer object. */\n //% property\n int length(Buffer s) {\n return s->length;\n }\n\n /**\n * Fill (a fragment) of the buffer with given value.\n */\n //%\n void fill(Buffer buf, int value, int offset = 0, int length = -1)\n {\n ManagedBuffer(buf).fill(value, offset, length);\n }\n\n /**\n * Return a copy of a fragment of a buffer.\n */\n //%\n Buffer slice(Buffer buf, int offset = 0, int length = -1)\n {\n return ManagedBuffer(buf).slice(offset, length).leakData();\n }\n\n /**\n * Shift buffer left in place, with zero padding.\n * @param offset number of bytes to shift; use negative value to shift right\n * @param start start offset in buffer. Default is 0.\n * @param length number of elements in buffer. If negative, length is set as the buffer length minus start. eg: -1\n */\n //%\n void shift(Buffer buf, int offset, int start = 0, int length = -1)\n {\n ManagedBuffer(buf).shift(offset, start, length);\n }\n\n /**\n * Rotate buffer left in place.\n * @param offset number of bytes to shift; use negative value
"control.cpp": "#include \"pxt.h\"\n\n/**\n * How to create the event.\n */\nenum class EventCreationMode {\n /**\n * MicroBitEvent is initialised, and no further processing takes place.\n */\n CreateOnly = CREATE_ONLY,\n /**\n * MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!).\n */\n CreateAndFire = CREATE_AND_FIRE,\n};\n\n// note the trailing '_' in names - otherwise we get conflict with the pre-processor\n// this trailing underscore is removed by enums.d.ts generation process\n\n// TODO shouldn't these be renamed to something more sensible anyways?\n\nenum EventBusSource {\n MICROBIT_ID_BUTTON_A_ = MICROBIT_ID_BUTTON_A,\n MICROBIT_ID_BUTTON_B_ = MICROBIT_ID_BUTTON_B,\n MICROBIT_ID_BUTTON_AB_ = MICROBIT_ID_BUTTON_AB,\n MICROBIT_ID_RADIO_ = MICROBIT_ID_RADIO,\n MICROBIT_ID_GESTURE_ = MICROBIT_ID_GESTURE,\n MICROBIT_ID_ACCELEROMETER_ = MICROBIT_ID_ACCELEROMETER,\n MICROBIT_ID_IO_P0_ = MICROBIT_ID_IO_P0,\n MICROBIT_ID_IO_P1_ = MICROBIT_ID_IO_P1,\n MICROBIT_ID_IO_P2_ = MICROBIT_ID_IO_P2,\n MICROBIT_ID_IO_P3_ = MICROBIT_ID_IO_P3,\n MICROBIT_ID_IO_P4_ = MICROBIT_ID_IO_P4,\n MICROBIT_ID_IO_P5_ = MICROBIT_ID_IO_P5,\n MICROBIT_ID_IO_P6_ = MICROBIT_ID_IO_P6,\n MICROBIT_ID_IO_P7_ = MICROBIT_ID_IO_P7,\n MICROBIT_ID_IO_P8_ = MICROBIT_ID_IO_P8,\n MICROBIT_ID_IO_P9_ = MICROBIT_ID_IO_P9,\n MICROBIT_ID_IO_P10_ = MICROBIT_ID_IO_P10,\n MICROBIT_ID_IO_P11_ = MICROBIT_ID_IO_P11,\n MICROBIT_ID_IO_P12_ = MICROBIT_ID_IO_P12,\n MICROBIT_ID_IO_P13_ = MICROBIT_ID_IO_P13,\n MICROBIT_ID_IO_P14_ = MICROBIT_ID_IO_P14,\n MICROBIT_ID_IO_P15_ = MICROBIT_ID_IO_P15,\n MICROBIT_ID_IO_P16_ = MICROBIT_ID_IO_P16,\n MICROBIT_ID_IO_P19_ = MICROBIT_ID_IO_P19,\n MICROBIT_ID_IO_P20_ = MICROBIT_ID_IO_P20,\n MICROBIT_ID_IO_P21_ = MICROBIT_ID_IO_P21,\n MES_DEVICE_INFO_ID_ = MES_DEVICE_INFO_ID,\n MES_SIGNAL_STRENGTH_ID_ = MES_SIGNAL_STRENGTH_ID,\n MES_DPAD_CONTROLLER_ID_ = MES_DPAD_CONTROLLER_ID,\n MES_BROADCAST_GENERAL_ID_ = MES_BROADCAST_GENERAL_ID,\n};\n\nenum EventBusValue {\n MICROBIT_EVT_ANY_ = MICROBIT_EVT_ANY,\n MICROBIT_BUTTON_EVT_CLICK_ = MICROBIT_BUTTON_EVT_CLICK,\n MICROBIT_RADIO_EVT_DATAGRAM_ = MICROBIT_RADIO_EVT_DATAGRAM,\n MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE_ = MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE,\n MICROBIT_PIN_EVT_RISE_ = MICROBIT_PIN_EVT_RISE,\n MICROBIT_PIN_EVT_FALL_ = MICROBIT_PIN_EVT_FALL,\n MICROBIT_PIN_EVT_PULSE_HI_ = MICROBIT_PIN_EVT_PULSE_HI,\n MICROBIT_PIN_EVT_PULSE_LO_ = MICROBIT_PIN_EVT_PULSE_LO,\n MES_ALERT_EVT_ALARM1_ = MES_ALERT_EVT_ALARM1,\n MES_ALERT_EVT_ALARM2_ = MES_ALERT_EVT_ALARM2,\n MES_ALERT_EVT_ALARM3_ = MES_ALERT_EVT_ALARM3,\n MES_ALERT_EVT_ALARM4_ = MES_ALERT_EVT_ALARM4,\n MES_ALERT_EVT_ALARM5_ = MES_ALERT_EVT_ALARM5,\n MES_ALERT_EVT_ALARM6_ = MES_ALERT_EVT_ALARM6,\n MES_ALERT_EVT_DISPLAY_TOAST_ = MES_ALERT_EVT_DISPLAY_TOAST,\n MES_ALERT_EVT_FIND_MY_PHONE_ = MES_ALERT_EVT_FIND_MY_PHONE,\n MES_ALERT_EVT_PLAY_RINGTONE_ = MES_ALERT_EVT_PLAY_RINGTONE,\n MES_ALERT_EVT_PLAY_SOUND_ = MES_ALERT_EVT_PLAY_SOUND,\n MES_ALERT_EVT_VIBRATE_ = MES_ALERT_EVT_VIBRATE,\n MES_CAMERA_EVT_LAUNCH_PHOTO_MODE_ = MES_CAMERA_EVT_LAUNCH_PHOTO_MODE,\n MES_CAMERA_EVT_LAUNCH_VIDEO_MODE_ = MES_CAMERA_EVT_LAUNCH_VIDEO_MODE,\n MES_CAMERA_EVT_START_VIDEO_CAPTURE_ = MES_CAMERA_EVT_START_VIDEO_CAPTURE,\n MES_CAMERA_EVT_STOP_PHOTO_MODE_ = MES_CAMERA_EVT_STOP_PHOTO_MODE,\n MES_CAMERA_EVT_STOP_VIDEO_CAPTURE_ = MES_CAMERA_EVT_STOP_VIDEO_CAPTURE,\n MES_CAMERA_EVT_STOP_VIDEO_MODE_ = MES_CAMERA_EVT_STOP_VIDEO_MODE,\n MES_CAMERA_EVT_TAKE_PHOTO_ = MES_CAMERA_EVT_TAKE_PHOTO,\n MES_CAMERA_EVT_TOGGLE_FRONT_REAR_ = MES_CAMERA_EVT_TOGGLE_FRONT_REAR,\n MES_DEVICE_DISPLAY_OFF_ = MES_DEVICE_DISPLAY_OFF,\n MES_DEVICE_DISPLAY_ON_ = MES_DEVICE_DISPLAY_ON,\n MES_DEVICE_GESTURE_DEVICE_SHAKEN_ = MES_DEVICE_GESTURE_DEVICE_SHAKEN,\n MES_DEVICE_INCOMING_CALL_ = MES_DEVICE_INCOMING_CALL,\n MES_DEVICE_
"control.ts": "/**\n* Runtime and event utilities.\n*/\n//% weight=1 color=\"#42495F\" icon=\"\\uf233\"\n//% advanced=true\nnamespace control {\n\n /**\n * Returns the value of a C++ runtime constant\n */\n //% weight=2 weight=19 blockId=\"control_event_source_id\" block=\"%id\" blockGap=8\n //% shim=TD_ID\n export function eventSourceId(id: EventBusSource): number {\n return id;\n }\n /**\n * Returns the value of a C++ runtime constant\n */\n //% weight=1 weight=19 blockId=\"control_event_value_id\" block=\"%id\"\n //% shim=TD_ID\n export function eventValueId(id: EventBusValue): number {\n return id;\n }\n\n /**\n * Display specified error code and stop the program.\n */\n //% shim=pxtrt::panic\n export function panic(code: number) { }\n\n /**\n * If the condition is false, display msg on serial console, and panic with code 098.\n */\n export function assert(condition: boolean, msg ?: string) {\n if (!condition) {\n console.log(\"ASSERTION FAILED\")\n if (msg != null) {\n console.log(msg)\n }\n panic(98)\n }\n }\n\n /**\n * Display warning in the simulator.\n */\n //% shim=pxtrt::runtimeWarning\n export function runtimeWarning(message: string) { }\n}\n",
"core.cpp": "#include \"pxt.h\"\n#include <limits.h>\n\n\nnamespace String_ {\n //%\n StringData *charAt(StringData *s, int pos) {\n return ManagedString((char)ManagedString(s).charAt(pos)).leakData();\n }\n\n //%\n int charCodeAt(StringData *s, int index) {\n return ManagedString(s).charAt(index);\n }\n\n //%\n StringData *concat(StringData *s, StringData *other) {\n ManagedString a(s), b(other);\n return (a + b).leakData();\n }\n\n //%\n int compare(StringData *s, StringData *that) {\n int compareResult = strcmp(s->data, that->data);\n if (compareResult < 0)\n return -1;\n else if (compareResult > 0)\n return 1;\n return 0;\n }\n\n //%\n int length(StringData *s) { return s->len; }\n\n //%\n StringData *fromCharCode(int code)\n {\n return ManagedString((char)code).leakData();\n }\n\n //%\n int toNumber(StringData *s) {\n return atoi(s->data);\n }\n\n //%\n StringData *mkEmpty()\n {\n return ManagedString::EmptyString.leakData();\n }\n\n //%\n StringData *substr(StringData *s, int start, int length)\n {\n if (length <= 0)\n return mkEmpty();\n if (start < 0)\n start = max(s->len + start, 0);\n length = min(length, s->len - start);\n ManagedString x(s);\n return x.substring(start, length).leakData();\n }\n}\n\n\nnamespace Boolean_ {\n // Cache the string literals \"true\" and \"false\" when used.\n // Note that the representation of booleans stays the usual C-one.\n \n static const char sTrue[] __attribute__ ((aligned (4))) = \"\\xff\\xff\\x04\\x00\" \"true\\0\";\n static const char sFalse[] __attribute__ ((aligned (4))) = \"\\xff\\xff\\x05\\x00\" \"false\\0\";\n\n //%\n StringData* toString(bool v)\n {\n if (v) {\n return (StringData*)(void*)sTrue;\n } else {\n return (StringData*)(void*)sFalse;\n } \n }\n\n //%\n bool bang(int v) { return v == 0; }\n}\n\nnamespace Number_ {\n //%\n StringData* toString(int n)\n {\n return ManagedString(n).leakData();\n }\n\n // +, - and friends are handled directly by assembly instructions\n // The comparisons are here as they are more code-size efficient\n \n //%\n bool lt(int x, int y) { return x < y; }\n //%\n bool le(int x, int y) { return x <= y; }\n //%\n bool neq(int x, int y) { return x != y; }\n //%\n bool eq(int x, int y) { return x == y; }\n //%\n bool gt(int x, int y) { return x > y; }\n //%\n bool ge(int x, int y) { return x >= y; }\n\n // These in fact call into C runtime on Cortex-M0 \n //%\n int div(int x, int y) { return x / y; }\n //%\n int mod(int x, int y) { return x % y; }\n}\n\nnamespace Math_ {\n //%\n int pow(int x, int y)\n {\n if (y < 0)\n return 0;\n int r = 1;\n while (y) {\n if (y & 1)\n r *= x;\n y >>= 1;\n x *= x;\n }\n return r;\n }\n \n //%\n int random(int max) {\n if (max == INT_MIN)\n return -microbit_random(INT_MAX);\n else if (max < 0)\n return -microbit_random(-max);\n else if (max == 0)\n return 0;\n else\n return microbit_random(max);\n }\n \n //%\n int sqrt(int x)\n {\n return ::sqrt(x);\n }\n}\n\nnamespace Array_ {\n //%\n RefCollection *mk(uint32_t flags)\n {\n return new RefCollection(flags);\n }\n //%\n int length(RefCollection *c) { return c->length(); }\n //%\n void setLength(RefCollection *c, int newLength) { c->setLength(newLength); } \n //%\n void push(RefCollection *c, uint32_t x) { c->push(x); }\n //%\n uint32_t pop(RefCollection *c) { return c->pop(); } \n //%\n uint32_t getAt(RefCollection *c, int x) { return c->getAt(x); }\n //%\n void setAt(RefCollection *c, int x, uint32_t y) { c->setAt(x, y); } \n //%\n uint32_t removeAt(RefCollection *c, int
"dal.d.ts": "// Auto-generated. Do not edit.\ndeclare const enum DAL {\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth/ExternalEvents.h\n MICROBIT_ID_BLE = 1000,\n MICROBIT_ID_BLE_UART = 1200,\n MICROBIT_BLE_EVT_CONNECTED = 1,\n MICROBIT_BLE_EVT_DISCONNECTED = 2,\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MESEvents.h\n MES_REMOTE_CONTROL_ID = 1001,\n MES_REMOTE_CONTROL_EVT_PLAY = 1,\n MES_REMOTE_CONTROL_EVT_PAUSE = 2,\n MES_REMOTE_CONTROL_EVT_STOP = 3,\n MES_REMOTE_CONTROL_EVT_NEXTTRACK = 4,\n MES_REMOTE_CONTROL_EVT_PREVTRACK = 5,\n MES_REMOTE_CONTROL_EVT_FORWARD = 6,\n MES_REMOTE_CONTROL_EVT_REWIND = 7,\n MES_REMOTE_CONTROL_EVT_VOLUMEUP = 8,\n MES_REMOTE_CONTROL_EVT_VOLUMEDOWN = 9,\n MES_CAMERA_ID = 1002,\n MES_CAMERA_EVT_LAUNCH_PHOTO_MODE = 1,\n MES_CAMERA_EVT_LAUNCH_VIDEO_MODE = 2,\n MES_CAMERA_EVT_TAKE_PHOTO = 3,\n MES_CAMERA_EVT_START_VIDEO_CAPTURE = 4,\n MES_CAMERA_EVT_STOP_VIDEO_CAPTURE = 5,\n MES_CAMERA_EVT_STOP_PHOTO_MODE = 6,\n MES_CAMERA_EVT_STOP_VIDEO_MODE = 7,\n MES_CAMERA_EVT_TOGGLE_FRONT_REAR = 8,\n MES_ALERTS_ID = 1004,\n MES_ALERT_EVT_DISPLAY_TOAST = 1,\n MES_ALERT_EVT_VIBRATE = 2,\n MES_ALERT_EVT_PLAY_SOUND = 3,\n MES_ALERT_EVT_PLAY_RINGTONE = 4,\n MES_ALERT_EVT_FIND_MY_PHONE = 5,\n MES_ALERT_EVT_ALARM1 = 6,\n MES_ALERT_EVT_ALARM2 = 7,\n MES_ALERT_EVT_ALARM3 = 8,\n MES_ALERT_EVT_ALARM4 = 9,\n MES_ALERT_EVT_ALARM5 = 10,\n MES_ALERT_EVT_ALARM6 = 11,\n MES_SIGNAL_STRENGTH_ID = 1101,\n MES_SIGNAL_STRENGTH_EVT_NO_BAR = 1,\n MES_SIGNAL_STRENGTH_EVT_ONE_BAR = 2,\n MES_SIGNAL_STRENGTH_EVT_TWO_BAR = 3,\n MES_SIGNAL_STRENGTH_EVT_THREE_BAR = 4,\n MES_SIGNAL_STRENGTH_EVT_FOUR_BAR = 5,\n MES_DEVICE_INFO_ID = 1103,\n MES_DEVICE_ORIENTATION_LANDSCAPE = 1,\n MES_DEVICE_ORIENTATION_PORTRAIT = 2,\n MES_DEVICE_GESTURE_NONE = 3,\n MES_DEVICE_GESTURE_DEVICE_SHAKEN = 4,\n MES_DEVICE_DISPLAY_OFF = 5,\n MES_DEVICE_DISPLAY_ON = 6,\n MES_DEVICE_INCOMING_CALL = 7,\n MES_DEVICE_INCOMING_MESSAGE = 8,\n MES_DPAD_CONTROLLER_ID = 1104,\n MES_DPAD_BUTTON_A_DOWN = 1,\n MES_DPAD_BUTTON_A_UP = 2,\n MES_DPAD_BUTTON_B_DOWN = 3,\n MES_DPAD_BUTTON_B_UP = 4,\n MES_DPAD_BUTTON_C_DOWN = 5,\n MES_DPAD_BUTTON_C_UP = 6,\n MES_DPAD_BUTTON_D_DOWN = 7,\n MES_DPAD_BUTTON_D_UP = 8,\n MES_DPAD_BUTTON_1_DOWN = 9,\n MES_DPAD_BUTTON_1_UP = 10,\n MES_DPAD_BUTTON_2_DOWN = 11,\n MES_DPAD_BUTTON_2_UP = 12,\n MES_DPAD_BUTTON_3_DOWN = 13,\n MES_DPAD_BUTTON_3_UP = 14,\n MES_DPAD_BUTTON_4_DOWN = 15,\n MES_DPAD_BUTTON_4_UP = 16,\n MES_BROADCAST_GENERAL_ID = 2000,\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitAccelerometerService.h\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitBLEManager.h\n MICROBIT_BLE_PAIR_REQUEST = 0x01,\n MICROBIT_BLE_PAIR_COMPLETE = 0x02,\n MICROBIT_BLE_PAIR_PASSCODE = 0x04,\n MICROBIT_BLE_PAIR_SUCCESSFUL = 0x08,\n MICROBIT_BLE_PAIRING_TIMEOUT = 90,\n MICROBIT_BLE_POWER_LEVELS = 8,\n MICROBIT_BLE_MAXIMUM_BONDS = 4,\n MICROBIT_BLE_EDDYSTONE_ADV_INTERVAL = 400,\n MICROBIT_BLE_EDDYSTONE_DEFAULT_POWER = 0xF0,\n MICROBIT_BLE_STATUS_STORE_SYSATTR = 0x02,\n MICROBIT_BLE_STATUS_DISCONNECT = 0x04,\n MICROBIT_BLE_DISCONNECT_AFTER_PAIRING_DELAY = 500,\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitButtonService.h\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitDFUService.h\n MICROBIT_DFU_OPCODE_START_DFU = 1,\n MICROBIT_DFU_HISTOGRAM_WIDTH = 5,\n MICROBIT_DFU_HISTOGRAM_HEIGHT = 5,\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitEddystone.h\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitEventService.h\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth/MicroBitIOPinService.h\n MICROBIT_IO_PIN_SERVICE_PINCOUNT = 19,\n MICROBIT_IO_PIN_SERVICE_DATA_SIZE = 10,\n MICROBIT_PWM_PIN_SERVICE_DATA_SIZE = 2,\n // built/yt/yotta_modules/microbit-dal/inc/bluetooth
"enums.d.ts": "// Auto-generated. Do not edit.\ndeclare namespace images {\n}\ndeclare namespace basic {\n}\n\n\n declare enum Button {\n A = 1, // MICROBIT_ID_BUTTON_A\n B = 2, // MICROBIT_ID_BUTTON_B\n //% block=\"A+B\"\n AB = 26, // MICROBIT_ID_BUTTON_AB\n }\n\n\n declare enum Dimension {\n //% block=x\n X = 0,\n //% block=y\n Y = 1,\n //% block=z\n Z = 2,\n //% block=strength\n Strength = 3,\n }\n\n\n declare enum Rotation {\n //% block=pitch\n Pitch = 0,\n //% block=roll\n Roll = 1,\n }\n\n\n declare enum TouchPin {\n P0 = 19, // MICROBIT_ID_IO_P12\n P1 = 7, // MICROBIT_ID_IO_P0\n P2 = 8, // MICROBIT_ID_IO_P1\n P3 = 23, // MICROBIT_ID_IO_P16\n }\n\n\n declare enum AcceleratorRange {\n /**\n * The accelerator measures forces up to 1 gravity\n */\n //% block=\"1g\"\n OneG = 1,\n /**\n * The accelerator measures forces up to 2 gravity\n */\n //% block=\"2g\"\n TwoG = 2,\n /**\n * The accelerator measures forces up to 4 gravity\n */\n //% block=\"4g\"\n FourG = 4,\n /**\n * The accelerator measures forces up to 8 gravity\n */\n //% block=\"8g\"\n EightG = 8,\n }\n\n\n declare enum Gesture {\n /**\n * Raised when shaken\n */\n //% block=shake\n Shake = 12, // MICROBIT_ACCELEROMETER_EVT_SHAKE\n /**\n * Raised when the logo is upward and the screen is vertical\n */\n //% block=\"logo up\"\n LogoUp = 1, // MICROBIT_ACCELEROMETER_EVT_TILT_UP\n /**\n * Raised when the logo is downward and the screen is vertical\n */\n //% block=\"logo down\"\n LogoDown = 2, // MICROBIT_ACCELEROMETER_EVT_TILT_DOWN\n /**\n * Raised when the screen is pointing down and the board is horizontal\n */\n //% block=\"screen up\"\n ScreenUp = 5, // MICROBIT_ACCELEROMETER_EVT_FACE_UP\n /**\n * Raised when the screen is pointing up and the board is horizontal\n */\n //% block=\"screen down\"\n ScreenDown = 6, // MICROBIT_ACCELEROMETER_EVT_FACE_DOWN\n /**\n * Raised when the screen is pointing left\n */\n //% block=\"tilt left\"\n TiltLeft = 3, // MICROBIT_ACCELEROMETER_EVT_TILT_LEFT\n /**\n * Raised when the screen is pointing right\n */\n //% block=\"tilt right\"\n TiltRight = 4, // MICROBIT_ACCELEROMETER_EVT_TILT_RIGHT\n /**\n * Raised when the board is falling!\n */\n //% block=\"free fall\"\n FreeFall = 7, // MICROBIT_ACCELEROMETER_EVT_FREEFALL\n /**\n * Raised when a 3G shock is detected\n */\n //% block=\"3g\"\n ThreeG = 9, // MICROBIT_ACCELEROMETER_EVT_3G\n /**\n * Raised when a 6G shock is detected\n */\n //% block=\"6g\"\n SixG = 10, // MICROBIT_ACCELEROMETER_EVT_6G\n }\ndeclare namespace input {\n}\n\n\n /**\n * How to create the event.\n */\n\n declare enum EventCreationMode {\n /**\n * MicroBitEvent is initialised, and no further processing takes place.\n */\n CreateOnly = 0, // CREATE_ONLY\n /**\n * MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!).\n */\n CreateAndFire = 1, // CREATE_AND_FIRE\n }\n\n\n declare enum EventBusSource {\n MICROBIT_ID_BUTTON_A = 1, // MICROBIT_ID_BUTTON_A\n MICROBIT_ID_BUTTON_B = 2, // MICROBIT_ID_BUTTON_B\n MICROBIT_ID_BUTTON_AB = 26, // MICROBIT_ID_BUTTON_AB\n MICROBIT_ID_RADIO = 29, // MICROBIT_ID_RADIO\n MICROBIT_ID_GESTURE = 27, // MICROBIT_ID_GESTURE\n MICROBIT_ID_ACCELEROMETER = 4, // MICROBIT_ID_ACCELEROMETER\n MICROBIT_ID_IO_P0 = 7, // MICROBIT_ID_IO_P0\n MICROBIT_ID_IO_P1 = 8, // MICROBIT_ID_IO_P1\n MICROBIT_ID_IO_P2 = 9, // MICROBIT_ID_IO_P2\n MICROBIT_ID_IO_P3 = 10, // MICROBIT_ID_IO_P3\n MICROBIT_ID_IO_P4 = 11, // MICROBIT_ID_IO_P4\n MICROBIT_ID_IO_P5 = 12, // MICROBIT_ID_IO_P5\n MICROBIT_ID_IO_P6 = 13, // MICROBIT_ID_IO_P6\n MICROBIT_ID_IO_P7 = 14, // MICROBIT_ID_IO_P7\n MICROB
"game.ts": "enum Direction {\n //% block=right\n Right,\n //% block=left\n Left\n}\n\nenum LedSpriteProperty {\n //% block=x\n X,\n //% block=y\n Y,\n //% block=direction\n Direction,\n //% block=brightness\n Brightness,\n //% block=blink\n Blink\n}\n\n/**\n * A single-LED sprite game engine\n */\n//% color=#008272 weight=32 icon=\"\\uf11b\"\n//% advanced=true\nnamespace game {\n let _score: number = 0;\n let _life: number = 3;\n let _startTime: number = 0;\n let _endTime: number = 0;\n let _isGameOver: boolean = false;\n let _countdownPause: number = 0;\n let _level: number = 1;\n let _gameId: number = 0;\n let img: Image;\n let sprites: LedSprite[];\n\n /**\n * Creates a new LED sprite pointing to the right.\n * @param x sprite horizontal coordinate, eg: 2\n * @param y sprite vertical coordinate, eg: 2\n */\n //% weight=60\n //% blockId=game_create_sprite block=\"create sprite at|x: %x|y: %y\"\n //% parts=\"ledmatrix\"\n export function createSprite(x: number, y: number): LedSprite {\n init();\n let p = new LedSprite(x, y);\n sprites.push(p);\n plot();\n return p;\n }\n\n /**\n * Gets the current score\n */\n //% weight=9 help=game/score\n //% blockId=game_score block=\"score\" blockGap=8\n export function score(): number {\n return _score;\n }\n\n /**\n * Adds points to the current score\n * @param points amount of points to change, eg: 1\n */\n //% weight=10 help=game/add-score\n //% blockId=game_add_score block=\"change score by|%points\" blockGap=8\n //% parts=\"ledmatrix\"\n export function addScore(points: number): void {\n setScore(_score + points);\n control.inBackground(() => {\n led.stopAnimation();\n basic.showAnimation(`0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0\n0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0`, 20);\n });\n }\n\n /**\n * Starts a game countdown timer\n * @param ms countdown duration in milliseconds, eg: 10000\n */\n //% weight=9 help=game/start-countdown\n //% blockId=game_start_countdown block=\"start countdown|(ms) %duration\" blockGap=8\n //% parts=\"ledmatrix\"\n export function startCountdown(ms: number): void {\n if (checkStart()) {\n basic.showAnimation(`1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0\n0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0\n1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0\n0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0\n1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0`, 400);\n _countdownPause = Math.max(500, ms);\n _startTime = -1;\n _endTime = input.runningTime() + _countdownPause;\n control.inBackground(() => {\n basic.pause(_countdownPause);\n gameOver();\n });\n }\n }\n\n /**\n * Displays a game over animation.\n */\n //% weight=8 help=game/game-over\n //% blockId=game_game_over block=\"game over\"\n //% parts=\"ledmatrix\"\n export function gameOver(): void {\n if (!_isGameOver) {\n _isGameOver = true;\n unplugEvents();\n led.stopAnimation();\n led.setBrightness(255);\n led.setDisplayMode(DisplayMode.BackAndWhite);\n while (true) {\n for (let i = 0;
"helpers.ts": "namespace console {\n export function log(msg: string) {\n serial.writeString(msg);\n serial.writeString(\"\\r\\n\");\n }\n}\n\nnamespace Math {\n /**\n * Generates a `true` or `false` value randomly, just like flipping a coin.\n */\n //% blockId=logic_random block=\"pick random true or false\"\n //% help=math/random-boolean color=230\n export function randomBoolean(): boolean {\n return Math.random(2) == 0;\n }\n}",
"icons.ts": "/*\nThe MIT License (MIT)\n\nCopyright (c) 2013-2016 The MicroPython-on-micro:bit Developers, as listed\nin the accompanying AUTHORS file\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n// Images from file microbitconstimage.cpp https://github.com/bbcmicrobit/micropython\n\nenum IconNames {\n //% block=\"heart\"\n Heart = 0,\n //% block=\"small heart\"\n SmallHeart,\n //% block=\"yes\"\n Yes,\n //% block=\"no\"\n No,\n //% block=\"happy\"\n Happy,\n //% block=\"sad\"\n Sad,\n //% block=\"confused\"\n Confused,\n //% block=\"angry\"\n Angry,\n //% block=\"asleep\"\n Asleep,\n //% block=\"surprised\"\n Surprised,\n //% block=\"silly\"\n Silly,\n //% block=\"fabulous\"\n Fabulous,\n //% block=\"meh\"\n Meh,\n //% block=\"t-shirt\"\n TShirt,\n //% block=\"roller skate\"\n Rollerskate,\n //% block=\"duck\"\n Duck,\n //% block=\"house\"\n House,\n //% block=\"tortoise\"\n Tortoise,\n //% block=\"butterfly\"\n Butterfly,\n //% block=\"stick figure\"\n StickFigure,\n //% block=\"ghost\"\n Ghost,\n //% block=\"sword\"\n Sword,\n //% block=\"giraffe\"\n Giraffe,\n //% block=\"skull\"\n Skull,\n //% block=\"umbrella\"\n Umbrella,\n //% block=\"snake\"\n Snake,\n //% block=\"rabbit\"\n Rabbit,\n //% block=\"cow\"\n Cow,\n //% block=\"quarter note\"\n QuarterNote,\n //% block=\"eigth note\"\n EigthNote,\n //% block=\"pitchfork\"\n Pitchfork,\n //% block=\"pac man\"\n Pacman,\n //% block=\"target\"\n Target,\n //% block=\"triangle\"\n Triangle,\n //% block=\"left triangle\"\n LeftTriangle,\n //% block=\"chess board\"\n Chessboard,\n //% block=\"diamond\"\n Diamond,\n //% block=\"small diamond\"\n SmallDiamond,\n //% block=\"square\"\n Square,\n //% block=\"small square\"\n SmallSquare, \n}\n\nenum ArrowNames {\n //% blockIdentity=images.arrowNumber\n North = 0,\n //% blockIdentity=images.arrowNumber\n NorthEast,\n //% blockIdentity=images.arrowNumber\n East,\n //% blockIdentity=images.arrowNumber\n SouthEast,\n //% blockIdentity=images.arrowNumber\n South,\n //% blockIdentity=images.arrowNumber \n SouthWest,\n //% blockIdentity=images.arrowNumber\n West,\n //% blockIdentity=images.arrowNumber\n NorthWest,\n}\n\nnamespace basic {\n\n /**\n * Draws the selected icon on the LED screen\n */\n //% weight=90 blockGap=8\n //% blockId=basic_show_icon \n //% block=\"show icon %i\" icon=\"\\uf00a\"\n //% parts=\"ledmatrix\"\n //% help=basic/show-icon\n export function showIcon(icon: IconNames) {\n let res = images.iconImage(icon)\n res.showImage(0)\n }\n\n //% weight=50 blockGap=8\n //% blockId=basic_show_arrow \n //% block=\"show arrow %i=device_arrow\"\n //% parts=\"ledmatrix\"\n //% advanced=true\n //% help=basic/show-arrow\n export function showArrow(i: number) {\n let res = image
"images.cpp": "#include \"pxt.h\"\n\n/**\n* Creation, manipulation and display of LED images.\n*/\n//% color=#5C2D91 weight=31 icon=\"\\uf03e\"\n//% advanced=true\nnamespace images {\n /**\n * Creates an image that fits on the LED screen.\n */\n //% weight=75 help=images/create-image\n //% blockId=device_build_image block=\"create image\"\n //% parts=\"ledmatrix\"\n Image createImage(ImageLiteral leds) {\n return MicroBitImage(imageBytes(leds)).clone().leakData();\n }\n\n /**\n * Creates an image with 2 frames.\n */\n //% weight=74 help=images/create-big-image\n //% blockId=device_build_big_image block=\"create big image\" imageLiteral=2\n //% parts=\"ledmatrix\"\n Image createBigImage(ImageLiteral leds) {\n return createImage(leds);\n }\n}\n\nnamespace ImageMethods {\n /**\n * Plots the image at a given column to the screen\n */\n //% help=images/plot-image\n //% parts=\"ledmatrix\"\n void plotImage(Image i, int xOffset = 0) {\n uBit.display.print(MicroBitImage(i), -xOffset, 0, 0, 0);\n }\n\n /**\n * Shows an frame from the image at offset ``x offset``.\n * @param xOffset column index to start displaying the image\n */\n //% help=images/show-image weight=80 blockNamespace=images\n //% blockId=device_show_image_offset block=\"show image %sprite|at offset %offset\" blockGap=8\n //% parts=\"ledmatrix\" async\n void showImage(Image sprite, int xOffset, int interval = 400) {\n uBit.display.print(MicroBitImage(sprite), -xOffset, 0, 0, interval);\n }\n\n /**\n * Draws the ``index``-th frame of the image on the screen.\n * @param xOffset column index to start displaying the image\n */\n //% help=images/plot-frame weight=80\n //% parts=\"ledmatrix\"\n void plotFrame(Image i, int xOffset) {\n // TODO showImage() used in original implementation\n plotImage(i, xOffset * 5);\n }\n\n /**\n * Scrolls an image .\n * @param frameOffset x offset moved on each animation step, eg: 1, 2, 5\n * @param interval time between each animation step in milli seconds, eg: 200\n */\n //% help=images/show-image weight=79 async blockNamespace=images\n //% blockId=device_scroll_image block=\"scroll image %sprite|with offset %frameoffset|and interval (ms) %delay\" blockGap=8\n //% parts=\"ledmatrix\"\n void scrollImage(Image id, int frameOffset, int interval) {\n MicroBitImage i(id);\n uBit.display.animate(i, interval, frameOffset, MICROBIT_DISPLAY_WIDTH - 1);\n }\n\n\n /**\n * Sets all pixels off.\n */\n //% help=images/clear\n //% parts=\"ledmatrix\"\n void clear(Image i) {\n MicroBitImage(i).clear();\n }\n\n /**\n * Sets a specific pixel brightness at a given position\n */\n //%\n //% parts=\"ledmatrix\"\n void setPixelBrightness(Image i, int x, int y, int value) {\n MicroBitImage(i).setPixelValue(x, y, value);\n }\n\n\n /**\n * Gets the pixel brightness ([0..255]) at a given position\n */\n //%\n //% parts=\"ledmatrix\"\n int pixelBrightness(Image i, int x, int y) {\n int pix = MicroBitImage(i).getPixelValue(x, y);\n if (pix < 0) return 0;\n return pix;\n }\n\n\n /**\n * Gets the width in columns\n */\n //% help=functions/width\n int width(Image i) {\n return i->width;\n }\n\n /**\n * Gets the height in rows (always 5)\n */\n //%\n int height(Image i) {\n return i->height;\n }\n\n /**\n * Set a pixel state at position ``(x,y)``\n * @param x TODO\n * @param y TODO\n * @param value TODO\n */\n //% help=images/set-pixel\n //% parts=\"ledmatrix\"\n void setPixel(Image i, int x, int y, bool value) {\n setPixelBrightness(i, x, y, value ? 255 : 0);\n }\n\n /**\n * Get the pixel state at position ``(x,y)``\n * @param x TODO\n * @param y TODO\n */\n //% help=images/pixel\n //% parts=\"ledmatrix\"\n bool pixel(Image i, int x, int y)
"input.cpp": "#include \"pxt.h\"\n\nenum class Button {\n A = MICROBIT_ID_BUTTON_A,\n B = MICROBIT_ID_BUTTON_B,\n //% block=\"A+B\"\n AB = MICROBIT_ID_BUTTON_AB,\n};\n\nenum class Dimension {\n //% block=x\n X = 0,\n //% block=y\n Y = 1,\n //% block=z\n Z = 2,\n //% block=strength\n Strength = 3,\n};\n\nenum class Rotation {\n //% block=pitch\n Pitch = 0,\n //% block=roll\n Roll = 1,\n};\n\nenum class TouchPin {\n P0 = MICROBIT_ID_IO_P12,\n P1 = MICROBIT_ID_IO_P0,\n P2 = MICROBIT_ID_IO_P1,\n P3 = MICROBIT_ID_IO_P16\n};\n\nenum class AcceleratorRange {\n /**\n * The accelerator measures forces up to 1 gravity\n */\n //% block=\"1g\"\n OneG = 1,\n /**\n * The accelerator measures forces up to 2 gravity\n */\n //% block=\"2g\"\n TwoG = 2,\n /**\n * The accelerator measures forces up to 4 gravity\n */\n //% block=\"4g\"\n FourG = 4,\n /**\n * The accelerator measures forces up to 8 gravity\n */\n //% block=\"8g\"\n EightG = 8\n};\n\nenum class Gesture {\n /**\n * Raised when shaken\n */\n //% block=shake\n Shake = MICROBIT_ACCELEROMETER_EVT_SHAKE,\n /**\n * Raised when the logo is upward and the screen is vertical\n */\n //% block=\"logo up\"\n LogoUp = MICROBIT_ACCELEROMETER_EVT_TILT_UP,\n /**\n * Raised when the logo is downward and the screen is vertical\n */\n //% block=\"logo down\"\n LogoDown = MICROBIT_ACCELEROMETER_EVT_TILT_DOWN,\n /**\n * Raised when the screen is pointing down and the board is horizontal\n */\n //% block=\"screen up\"\n ScreenUp = MICROBIT_ACCELEROMETER_EVT_FACE_UP,\n /**\n * Raised when the screen is pointing up and the board is horizontal\n */\n //% block=\"screen down\"\n ScreenDown = MICROBIT_ACCELEROMETER_EVT_FACE_DOWN,\n /**\n * Raised when the screen is pointing left\n */\n //% block=\"tilt left\"\n TiltLeft = MICROBIT_ACCELEROMETER_EVT_TILT_LEFT,\n /**\n * Raised when the screen is pointing right\n */\n //% block=\"tilt right\"\n TiltRight = MICROBIT_ACCELEROMETER_EVT_TILT_RIGHT,\n /**\n * Raised when the board is falling!\n */\n //% block=\"free fall\"\n FreeFall = MICROBIT_ACCELEROMETER_EVT_FREEFALL,\n /**\n * Raised when a 3G shock is detected\n */\n //% block=\"3g\"\n ThreeG = MICROBIT_ACCELEROMETER_EVT_3G,\n /**\n * Raised when a 6G shock is detected\n */\n //% block=\"6g\"\n SixG = MICROBIT_ACCELEROMETER_EVT_6G\n};\n\n//% color=#C90072 weight=99 icon=\"\\uf192\"\nnamespace input {\n /**\n * Do something when a button (``A``, ``B`` or both ``A+B``) is pressed\n * @param button TODO\n * @param body TODO\n */\n //% help=input/on-button-pressed weight=85 blockGap=8\n //% blockId=device_button_event block=\"on button|%NAME|pressed\"\n //% parts=\"buttonpair\"\n void onButtonPressed(Button button, Action body) {\n registerWithDal((int)button, MICROBIT_BUTTON_EVT_CLICK, body);\n }\n\n /**\n * Do something when when a gesture is done (like shaking the micro:bit).\n * @param body TODO\n */\n //% help=input/on-gesture weight=84 blockGap=8\n //% blockId=device_gesture_event block=\"on |%NAME\"\n //% parts=\"accelerometer\"\n void onGesture(Gesture gesture, Action body) {\n if ((int)gesture == MICROBIT_ACCELEROMETER_EVT_3G && uBit.accelerometer.getRange() < 3)\n uBit.accelerometer.setRange(6);\n else if ((int)gesture == MICROBIT_ACCELEROMETER_EVT_6G && uBit.accelerometer.getRange() < 6)\n uBit.accelerometer.setRange(8);\n registerWithDal(MICROBIT_ID_GESTURE, (int)gesture, body);\n }\n\n /**\n * Do something when a pin is pressed.\n * @param name the pin that needs to be pressed\n * @param body the code to run when the pin is pressed\n */\n //% help=input/on-pin-pressed weight=83\n //% blockId=device_pin_event block=\"on pin %NAME|pressed\"\n void onPinPressed
"input.ts": "/**\n * Events and data from sensors\n */\n//% color=#C90072 weight=99\nnamespace input {\n /**\n * Attaches code to run when the screen is facing up.\n * @param body TODO\n */\n //% help=input/on-screen-up\n export function onScreenUp(body: Action): void {\n onGesture(Gesture.ScreenUp, body);\n }\n\n /**\n * Attaches code to run when the screen is facing down.\n * @param body TODO\n */\n //% help=input/on-screen-down\n export function onScreenDown(body: Action): void {\n onGesture(Gesture.ScreenDown, body);\n }\n\n /**\n * Attaches code to run when the device is shaken.\n * @param body TODO\n */\n //% help=input/on-shake\n export function onShake(body: Action): void {\n onGesture(Gesture.Shake, body);\n }\n\n /**\n * Attaches code to run when the logo is oriented upwards and the board is vertical.\n * @param body TODO\n */\n //% help=input/on-logo-up\n export function onLogoUp(body: Action): void {\n onGesture(Gesture.LogoUp, body);\n }\n\n /**\n * Attaches code to run when the logo is oriented downwards and the board is vertical.\n * @param body TODO\n */\n //% help=input/on-logo-down\n export function onLogoDown(body: Action): void {\n onGesture(Gesture.LogoDown, body);\n }\n}\n",
"led.cpp": "#include \"pxt.h\"\n\nenum class DisplayMode_ {\n //% block=\"black and white\"\n BackAndWhite = DISPLAY_MODE_BLACK_AND_WHITE,\n //% block=\"greyscale\"\n Greyscale = DISPLAY_MODE_GREYSCALE,\n // TODO DISPLAY_MODE_BLACK_AND_WHITE_LIGHT_SENSE\n};\n\n//% color=#8169E6 weight=35 icon=\"\\uf205\"\nnamespace led {\n\n /**\n * Turn on the specified LED using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left.\n * @param x TODO\n * @param y TODO\n */\n //% help=led/plot weight=78\n //% blockId=device_plot block=\"plot|x %x|y %y\" blockGap=8\n //% parts=\"ledmatrix\"\n void plot(int x, int y) {\n uBit.display.image.setPixelValue(x, y, 1);\n }\n\n /**\n * Turn off the specified LED using x, y coordinates (x is horizontal, y is vertical). (0,0) is upper left.\n * @param x TODO\n * @param y TODO\n */\n //% help=led/unplot weight=77\n //% blockId=device_unplot block=\"unplot|x %x|y %y\" blockGap=8\n //% parts=\"ledmatrix\"\n void unplot(int x, int y) {\n uBit.display.image.setPixelValue(x, y, 0);\n }\n\n /**\n * Get the on/off state of the specified LED using x, y coordinates. (0,0) is upper left.\n * @param x TODO\n * @param y TODO\n */\n //% help=led/point weight=76\n //% blockId=device_point block=\"point|x %x|y %y\"\n //% parts=\"ledmatrix\"\n bool point(int x, int y) {\n int pix = uBit.display.image.getPixelValue(x, y);\n return pix > 0;\n }\n\n /**\n * Get the screen brightness from 0 (off) to 255 (full bright).\n */\n //% help=led/brightness weight=60\n //% blockId=device_get_brightness block=\"brightness\" blockGap=8\n //% parts=\"ledmatrix\"\n //% advanced=true\n int brightness() {\n return uBit.display.getBrightness();\n }\n\n /**\n * Set the screen brightness from 0 (off) to 255 (full bright).\n * @param value the brightness value, eg:255, 127, 0\n */\n //% help=led/set-brightness weight=59\n //% blockId=device_set_brightness block=\"set brightness %value\"\n //% parts=\"ledmatrix\"\n //% advanced=true\n void setBrightness(int value) {\n uBit.display.setBrightness(value);\n }\n\n /**\n * Cancels the current animation and clears other pending animations.\n */\n //% weight=50 help=led/stop-animation\n //% blockId=device_stop_animation block=\"stop animation\"\n //% parts=\"ledmatrix\"\n //% advanced=true\n void stopAnimation() {\n uBit.display.stopAnimation();\n }\n\n /**\n * Sets the display mode between black and white and greyscale for rendering LEDs.\n * @param mode mode the display mode in which the screen operates\n */\n //% weight=1 help=led/set-display-mode\n //% parts=\"ledmatrix\" advanced=true\n void setDisplayMode(DisplayMode_ mode) {\n uBit.display.setDisplayMode((DisplayMode)mode);\n }\n\n /**\n * Turns on or off the display \n */\n //% help=led/enable blockId=device_led_enable\n //% advanced=true parts=\"ledmatrix\"\n void enable(bool on) {\n if (on) uBit.display.enable();\n else uBit.display.disable();\n }\n\n /**\n * Takes a screenshot of the LED screen and returns an image.\n */\n //% help=led/screenshot\n //% parts=\"ledmatrix\"\n Image screenshot() {\n return uBit.display.screenShot().leakData();\n /*\n let Image img;\n img = image.createImage(\"\");\n for (let i = 0; i < 5; i++) {\n for (let j = 0; j < 5; j++) {\n if (led.point(i, j)) {\n img.setPixel(i, j, true);\n }\n }\n }\n return img;\n */\n }\n}\n",
"led.ts": "/**\n * Control of the LED screen.\n */\n//% color=#8169E6 weight=97\n namespace led {\n\n // what's the current high value\n let barGraphHigh = 0;\n // when was the current high value recorded\n let barGraphHighLast = 0;\n\n /**\n * Displays a vertical bar graph based on the `value` and `high` value.\n * If `high` is 0, the chart gets adjusted automatically.\n * @param value current value to plot\n * @param high maximum value. If 0, maximum value adjusted automatically, eg: 0\n */\n //% help=led/plot-bar-graph weight=20\n //% blockId=device_plot_bar_graph block=\"plot bar graph of %value |up to %high\" icon=\"\\uf080\" blockExternalInputs=true\n //% parts=\"ledmatrix\"\n export function plotBarGraph(value: number, high: number): void {\n let now = input.runningTime();\n serial.writeString(value.toString() + \"\\r\\n\");\n value = Math.abs(value);\n\n if (high != 0) barGraphHigh = high;\n else if (value > barGraphHigh || now - barGraphHighLast > 10000) {\n barGraphHigh = value;\n barGraphHighLast = now;\n }\n\n barGraphHigh = Math.max(barGraphHigh, 16);\n\n let v = (value * 15) / barGraphHigh;\n let k = 0;\n for (let y = 4; y >= 0; --y) {\n for (let x = 0; x < 3; ++x) {\n if (k > v) {\n unplot(2 - x, y);\n unplot(2 + x, y);\n } else {\n plot(2 - x, y);\n plot(2 + x, y);\n }\n ++k;\n }\n }\n }\n\n /**\n * Toggles a particular pixel\n * @param x TODO\n * @param y TODO\n */\n //% help=led/toggle weight=77\n //% blockId=device_led_toggle block=\"toggle|x %x|y %y\" icon=\"\\uf204\" blockGap=8\n //% parts=\"ledmatrix\"\n export function toggle(x: number, y: number): void {\n if (led.point(x, y)) {\n led.unplot(x, y);\n } else {\n led.plot(x, y);\n }\n }\n\n /**\n * Turns all LEDS on\n */\n //% help=led/plot-all\n //% parts=\"ledmatrix\"\n export function plotAll(): void {\n for (let i = 0; i < 5; i++) {\n for (let j = 0; j < 5; j++) {\n led.plot(i, j);\n }\n }\n }\n\n /**\n * Inverts the current LED display\n */\n //% help=led/toggle-all\n //% parts=\"ledmatrix\"\n export function toggleAll(): void {\n for (let i = 0; i < 5; i++) {\n for (let j = 0; j < 5; j++) {\n led.toggle(i, j);\n }\n }\n }\n\n /**\n * Fades in the screen display.\n * @param ms TODO\n */\n //% help=led/fade-in\n //% parts=\"ledmatrix\"\n export function fadeIn(ms: number = 700): void {\n if (ms < 20) {\n led.setBrightness(255);\n return;\n }\n let dt = 50;\n let brightness = led.brightness();\n let start = input.runningTime();\n let elapsed = 0;\n while (elapsed < ms) {\n led.setBrightness(brightness + ((255 - brightness) * elapsed) / ms);\n basic.pause(dt);\n elapsed = input.runningTime() - start;\n }\n led.setBrightness(255);\n }\n\n /**\n * Fades out the screen brightness.\n * @param ms TODO\n */\n //% help=led/fade-out\n //% parts=\"ledmatrix\"\n export function fadeOut(ms: number = 700): void {\n if (ms < 20) {\n led.setBrightness(0);\n return;\n }\n let brightness = led.brightness();\n let dt = 50;\n let start = input.runningTime();\n let elapsed = 0;\n while (elapsed < ms) {\n led.setBrightness(brightness - (brightness * elapsed) / ms);\n basic.pause(dt);\n elapsed = input.runningTime() - start;\n }\n led.setBrightness(0);\n }\n\n\n}\n",
"motors.cpp": "#include \"pxt.h\"\n\nenum MotorCommand {\n //% block=coast\n Coast,\n //% block=break\n Break,\n //% block=sleep\n Sleep\n};\n\nenum Motor {\n A,\n B,\n //% block=\"A and B\"\n AB\n};\n\n/**\n* Blocks to control the onboard motors\n*/\n//% color=#008272 weight=30 icon=\"\\uf1b9\"\nnamespace motors {\n /**\n * Turns on the motor at a certain percent of power. Switches to single motor mode!\n * @param power %percent of power sent to the motor. Negative power goes backward. eg: 50\n */\n //% blockId=motor_on block=\"motor on at %percent\"\n //% parts=dcmotor weight=90 blockGap=8\n void motorPower(int power) {\n uBit.soundmotor.motorOn(power);\n }\n\n /**\n * Send break, coast or sleep commands to the motor. Has no effect in dual-motor mode.\n */\n //% blockId=motor_command block=\"motor %command\"\n //% parts=dcmotor weight=85\n void motorCommand(MotorCommand command) {\n switch(command) {\n case MotorCommand::Coast: uBit.soundmotor.motorCoast();break;\n case MotorCommand::Break: uBit.soundmotor.motorBreak();break;\n case MotorCommand::Sleep: uBit.soundmotor.motorSleep();break;\n }\n }\n\n /**\n * Controls two motors attached to the board. Switches to dual-motor mode!\n */\n //% blockId=block_dual_motor block=\"motor %motor|at %percent\"\n //% weight=80\n void dualMotorPower(Motor motor, int duty_percent) {\n switch(motor) {\n case Motor::A: if (duty_percent <= 0) uBit.soundmotor.motorAOff();\n else uBit.soundmotor.motorAOn(duty_percent); break;\n case Motor::B: if (duty_percent <= 0) uBit.soundmotor.motorBOff();\n else uBit.soundmotor.motorBOn(duty_percent); break;\n case Motor::AB: if (duty_percent <= 0) {\n uBit.soundmotor.motorAOff();\n uBit.soundmotor.motorBOff();\n } else {\n uBit.soundmotor.motorAOn(duty_percent);\n uBit.soundmotor.motorBOn(duty_percent);\n }\n break;\n }\n }\n}",
"music.cpp": "#include \"pxt.h\"\n\nnamespace music {\n /**\n * Plays a tone through ``speaker`` for the given duration.\n * @param frequency pitch of the tone to play in Hertz (Hz)\n * @param ms tone duration in milliseconds (ms)\n */\n //% help=music/play-tone weight=90\n //% blockId=device_play_note block=\"play|tone %note=device_note|for %duration=device_beat\" icon=\"\\uf025\" blockGap=8\n //% parts=\"speaker\" async useEnumVal=1\n void playTone(int frequency, int ms) {\n if(frequency > 0) uBit.soundmotor.soundOn(frequency);\n else uBit.soundmotor.soundOff();\n if(ms > 0) {\n uBit.sleep(ms);\n uBit.soundmotor.soundOff();\n }\n\n }\n}\n",
"music.ts": "enum Note {\n //% blockIdentity=music.noteFrequency enumval=262\n C = 262,\n //% block=C#\n //% blockIdentity=music.noteFrequency enumval=277\n CSharp = 277,\n //% blockIdentity=music.noteFrequency enumval=294\n D = 294,\n //% blockIdentity=music.noteFrequency enumval=311\n Eb = 311,\n //% blockIdentity=music.noteFrequency enumval=330\n E = 330,\n //% blockIdentity=music.noteFrequency enumval=349\n F = 349,\n //% block=F#\n //% blockIdentity=music.noteFrequency enumval=370\n FSharp = 370,\n //% blockIdentity=music.noteFrequency enumval=392\n G = 392,\n //% block=G#\n //% blockIdentity=music.noteFrequency enumval=415\n GSharp = 415,\n //% blockIdentity=music.noteFrequency enumval=440\n A = 440,\n //% blockIdentity=music.noteFrequency enumval=466\n Bb = 466,\n //% blockIdentity=music.noteFrequency enumval=494\n B = 494,\n //% blockIdentity=music.noteFrequency enumval=131\n C3 = 131,\n //% block=C#3\n //% blockIdentity=music.noteFrequency enumval=139\n CSharp3 = 139,\n //% blockIdentity=music.noteFrequency enumval=147\n D3 = 147,\n //% blockIdentity=music.noteFrequency enumval=156\n Eb3 = 156,\n //% blockIdentity=music.noteFrequency enumval=165\n E3 = 165,\n //% blockIdentity=music.noteFrequency enumval=175\n F3 = 175,\n //% block=F#3\n //% blockIdentity=music.noteFrequency enumval=185\n FSharp3 = 185,\n //% blockIdentity=music.noteFrequency enumval=196\n G3 = 196,\n //% block=G#3\n //% blockIdentity=music.noteFrequency enumval=208\n GSharp3 = 208,\n //% blockIdentity=music.noteFrequency enumval=220\n A3 = 220,\n //% blockIdentity=music.noteFrequency enumval=233\n Bb3 = 233,\n //% blockIdentity=music.noteFrequency enumval=247\n B3 = 247,\n //% blockIdentity=music.noteFrequency enumval=262\n C4 = 262,\n //% block=C#4\n //% blockIdentity=music.noteFrequency enumval=277\n CSharp4 = 277,\n //% blockIdentity=music.noteFrequency enumval=294\n D4 = 294,\n //% blockIdentity=music.noteFrequency enumval=311\n Eb4 = 311,\n //% blockIdentity=music.noteFrequency enumval=330\n E4 = 330,\n //% blockIdentity=music.noteFrequency enumval=349\n F4 = 349,\n //% block=F#4\n //% blockIdentity=music.noteFrequency enumval=370\n FSharp4 = 370,\n //% blockIdentity=music.noteFrequency enumval=392\n G4 = 392,\n //% block=G#4\n //% blockIdentity=music.noteFrequency enumval=415\n GSharp4 = 415,\n //% blockIdentity=music.noteFrequency enumval=440\n A4 = 440,\n //% blockIdentity=music.noteFrequency enumval=466\n Bb4 = 466,\n //% blockIdentity=music.noteFrequency enumval=494\n B4 = 494,\n //% blockIdentity=music.noteFrequency enumval=523\n C5 = 523,\n //% block=C#5\n //% blockIdentity=music.noteFrequency enumval=555\n CSharp5 = 555,\n //% blockIdentity=music.noteFrequency enumval=587\n D5 = 587,\n //% blockIdentity=music.noteFrequency enumval=622\n Eb5 = 622,\n //% blockIdentity=music.noteFrequency enumval=659\n E5 = 659,\n //% blockIdentity=music.noteFrequency enumval=698\n F5 = 698,\n //% block=F#5\n //% blockIdentity=music.noteFrequency enumval=740\n FSharp5 = 740,\n //% blockIdentity=music.noteFrequency enumval=784\n G5 = 784,\n //% block=G#5\n //% blockIdentity=music.noteFrequency enumval=831\n GSharp5 = 831,\n //% blockIdentity=music.noteFrequency enumval=880\n A5 = 880,\n //% blockIdentity=music.noteFrequency enumval=932\n Bb5 = 932,\n //% blockIdentity=music.noteFrequency enumval=988\n B5 = 988,\n}\n\nenum BeatFraction {\n //% block=1\n Whole = 1,\n //% block=\"1/2\"\n Half = 2,\n //% block=\"1/4\"\n Quarter = 4,\n //% block=\"1/8\"\n Eighth = 8,\n //% block=\"1/16\"\n Sixteenth = 16\n}\n\n/**\n * Generation of music tones through pin ``P0``.\n */\n//% color=#DF4600 weight=98 icon=\"\\uf025\"\nnamespace music {\n let beatsPerMinute: number = 120;\n\n /**\n * Rests (plays
"parts/dcmotor.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"488\" height=\"836\" viewBox=\"0 0 488 836\">\n <g transform=\"translate(0 -216.362)\">\n <rect width=\"34.286\" height=\"122.532\" x=\"226.365\" y=\"929.711\" fill=\"#ccc\" ry=\"16.162\"/>\n <path fill=\"gray\" d=\"M23.23 359.456A23.233 23.233 0 0 0 0 382.686v511.428a23.233 23.233 0 0 0 23.23 23.23h38.2v24.117a23.233 23.233 0 0 0 23.23 23.234h317.143a23.233 23.233 0 0 0 23.23-23.23v-24.118h38.197a23.233 23.233 0 0 0 23.23-23.23v-511.43a23.233 23.233 0 0 0-23.23-23.23h-440z\"/>\n <path fill=\"#333\" d=\"M23.23 357.82C10.4 357.82.002 368.22 0 381.05v511.427c.002 12.83 10.4 23.23 23.23 23.23h38.2v24.118c2.08 25.815 20.27 23.748 33.1 23.75 0 0-11.976-16.96-12.05-40.988-.057-17.923-9.03-12.008-8.176-39.76 2.743-237.84-2.423-390.158.37-522.93z\"/>\n <path fill=\"#fd5\" d=\"M23.508 286.934A23.51 18.415 0 0 0 0 305.347v69.375a23.51 18.415 0 0 0 23.508 18.413h440a23.51 18.415 0 0 0 23.508-18.413v-69.375a23.51 18.415 0 0 0-23.508-18.413h-440z\"/>\n <path fill=\"#c87137\" d=\"M77.156 216.362c-5.698 0-10.283 4.588-10.283 10.286v94.03c0 5.7 4.585 10.286 10.283 10.286h24.98c5.697 0 10.284-4.587 10.284-10.285v-94.034c0-5.698-4.587-10.286-10.285-10.286h-24.98zm10.18 10.37h4.018c5.095 0 9.197 4.103 9.197 9.2v28.032c0 5.096-4.1 9.197-9.194 9.197h-4.018c-5.096 0-9.2-4.1-9.2-9.194V235.93c0-5.095 4.104-9.197 9.2-9.197zm288.814-10.37c-5.697 0-10.283 4.588-10.283 10.286v94.03c0 5.7 4.586 10.286 10.283 10.286h24.98c5.697 0 10.284-4.587 10.284-10.285v-94.034c0-5.698-4.587-10.286-10.285-10.286h-24.98zm11.045 11.885h4.02c5.095 0 9.197 4.102 9.197 9.197v28.032c0 5.095-4.102 9.2-9.197 9.2h-4.02c-5.095 0-9.197-4.105-9.197-9.2v-28.032c0-5.095 4.102-9.197 9.197-9.197z\"/>\n <path fill=\"#fc0\" d=\"M170.587 306.637a17.633 17.633 0 0 0-17.63 17.63v67.587a17.633 17.633 0 0 0 17.63 17.63h34.852v20.57c0 15.162 12.756 27.915 27.913 27.915h24.976c15.157 0 27.916-12.756 27.916-27.917v-20.57h38.612a17.633 17.633 0 0 0 17.63-17.63v-67.587a17.633 17.633 0 0 0-17.63-17.63H170.585z\"/>\n <rect width=\"126.356\" height=\"29.385\" x=\"272.569\" y=\"914.707\" fill=\"#b3b3b3\" ry=\"14.693\"/>\n <rect width=\"169.991\" height=\"457.913\" x=\"300.928\" y=\"430.348\" fill=\"#b3b3b3\" ry=\"27.415\"/>\n </g>\n</svg>",
"parts/headphone.svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"142\" height=\"180\" viewBox=\"0 0 142 180\"><rect ry=\".3\" rx=\"1\" y=\"58.615\" x=\"-8.878\" height=\"23.571\" width=\"17.143\" transform=\"rotate(-45)\" fill=\"#b3b3b3\"/><rect ry=\".3\" rx=\"1\" y=\"32.043\" x=\"-8.878\" height=\"23.571\" width=\"17.143\" transform=\"rotate(-45)\" fill=\"#b3b3b3\"/><path d=\"M.346 7.296c-.394.39-.31 4.797-.18 4.898l13.404 10.18c.117.12.337 4.76.73 4.368l5.506-5.56.01.01 6.51-6.444c.39-.392-4.25-.614-4.366-.73L11.777.612c-.1-.132-4.51-.215-4.898.18L4.087 3.636l-.01-.01-3.73 3.67z\" fill=\"#b3b3b3\"/><rect ry=\"6.85\" rx=\"4.571\" y=\"84.758\" x=\"-20.128\" height=\"75.571\" width=\"39.643\" transform=\"rotate(-45)\"/><rect ry=\".374\" rx=\"1.038\" y=\"29.442\" x=\"-8.925\" height=\"2.228\" width=\"17.238\" transform=\"rotate(-45)\" fill=\"#fff\"/><rect ry=\".374\" rx=\"1.038\" y=\"55.939\" x=\"-8.925\" height=\"2.228\" width=\"17.238\" transform=\"rotate(-45)\" fill=\"#fff\"/><rect ry=\".374\" rx=\"1.038\" y=\"82.392\" x=\"-8.925\" height=\"2.228\" width=\"17.238\" transform=\"rotate(-45)\" fill=\"#fff\"/><rect ry=\"2.317\" rx=\"2.183\" y=\"158.876\" x=\"-9.774\" height=\"25.568\" width=\"18.935\" transform=\"rotate(-45)\"/><path d=\"M128.588 128.82s14.97 11.165 7.547 26.35c-8.426 17.24-25.57 20.653-25.57 20.653\" fill=\"none\" stroke=\"#000\" stroke-width=\"6.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>",
"parts/speaker.svg": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 500 500\" xmlns=\"http://www.w3.org/2000/svg\">\n <g transform=\"matrix(1, 0, 0, 1, -0.00023, -58.230297)\">\n <ellipse style=\"fill: rgb(70, 70, 70);\" cx=\"250.58\" cy=\"308.81\" rx=\"215\" ry=\"215\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" transform=\"matrix(1, 0, 0, 1.000001, -232.069031, 248.780606)\" cx=\"482.069\" cy=\"198.188\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" transform=\"matrix(1, 0, 0, 0.999999, -232.067871, 110.041956)\" cx=\"482.067\" cy=\"198.188\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"389.12\" cy=\"308.23\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"110.88\" cy=\"308.23\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"250\" cy=\"169.393\" rx=\"23.028\" ry=\"23.028\"/>\n <g transform=\"matrix(1, 0, 0, 1, -0.000009, 0.000015)\">\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"250\" cy=\"238.513\" rx=\"23.028\" ry=\"23.028\" transform=\"matrix(1.000001, 0, 0, 0.999999, 69.996739, 69.71816)\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" transform=\"matrix(1, 0, 0, 0.999999, -302.064453, 110.043115)\" cx=\"482.064\" cy=\"198.188\" rx=\"23.028\" ry=\"23.028\"/>\n </g>\n <g transform=\"matrix(0.866026, 0.5, -0.5, 0.866026, 7.386552, -105.261086)\">\n <ellipse style=\"fill: rgb(0, 0, 0);\" transform=\"matrix(0.999999, 0, 0, 0.999999, -65.212313, 177.387415)\" cx=\"482.068\" cy=\"198.188\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"555.975\" cy=\"236.836\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"277.735\" cy=\"236.836\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"416.855\" cy=\"97.999\" rx=\"23.028\" ry=\"23.028\"/>\n </g>\n <g transform=\"matrix(0.5, 0.866026, -0.866026, 0.5, 246.635941, -171.170502)\">\n <ellipse style=\"fill: rgb(0, 0, 0);\" transform=\"matrix(0.999999, 0, 0, 0.999999, -65.212313, 177.387415)\" cx=\"482.068\" cy=\"198.188\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"555.975\" cy=\"236.836\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"277.735\" cy=\"236.836\" rx=\"23.028\" ry=\"23.028\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"416.855\" cy=\"97.999\" rx=\"23.028\" ry=\"23.028\"/>\n </g>\n <g transform=\"matrix(-0.5, 0.866026, -0.866026, -0.5, 641.934998, 245.84082)\">\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"250\" cy=\"238.513\" rx=\"23.028\" ry=\"23.028\" transform=\"matrix(1.000001, 0, 0, 0.999999, 69.996739, 69.71816)\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" transform=\"matrix(1, 0, 0, 0.999999, -302.064453, 110.043115)\" cx=\"482.064\" cy=\"198.188\" rx=\"23.028\" ry=\"23.028\"/>\n </g>\n <g transform=\"matrix(-0.500001, -0.866026, 0.866026, -0.500001, 108.063393, 678.85083)\">\n <ellipse style=\"fill: rgb(0, 0, 0);\" cx=\"250\" cy=\"238.513\" rx=\"23.028\" ry=\"23.028\" transform=\"matrix(1.000001, 0, 0, 0.999999, 69.996739, 69.71816)\"/>\n <ellipse style=\"fill: rgb(0, 0, 0);\" transform=\"matrix(1, 0, 0, 0.999999, -302.064453, 110.043115)\" cx=\"482.064\" cy=\"198.188\" rx=\"23.028\" ry=\"23.028\"/>\n </g>\n </g>\n</svg>",
"pins.cpp": "#include \"pxt.h\"\n\nenum class DigitalPin {\n P0 = MICROBIT_ID_IO_P12, // edge connector 0\n P1 = MICROBIT_ID_IO_P0, // edge connector 1\n P2 = MICROBIT_ID_IO_P1, // edge connector 2\n P3 = MICROBIT_ID_IO_P16, // edge connector 3\n C4 = MICROBIT_ID_IO_P3, // LED matrix C1\n C5 = MICROBIT_ID_IO_P4, // LED matrix C2\n C6 = MICROBIT_ID_IO_P10, // LED matrix C3\n C7 = MICROBIT_ID_IO_P13, // LED matrix C4\n C8 = MICROBIT_ID_IO_P14, // LED matrix C5\n C9 = MICROBIT_ID_IO_P15, // LED matrix C6\n C10 = MICROBIT_ID_IO_P9, // LED matrix C7\n C11 = MICROBIT_ID_IO_P7, // LED matrix C8\n C12 = MICROBIT_ID_IO_P6, // LED matrix C9\n C16 = MICROBIT_ID_IO_P2, // RX\n C17 = MICROBIT_ID_IO_P8, // TX\n C18 = MICROBIT_ID_IO_P20, // SDA\n C19 = MICROBIT_ID_IO_P19 // SCL\n};\n\nenum class AnalogPin {\n P1 = MICROBIT_ID_IO_P0, // edge connector 1\n P2 = MICROBIT_ID_IO_P1, // edge connector 2\n C4 = MICROBIT_ID_IO_P3, // LED matrix C1\n C5 = MICROBIT_ID_IO_P4, // LED matrix C2\n C6 = MICROBIT_ID_IO_P10, // LED matrix C3\n C16 = MICROBIT_ID_IO_P2, // RX\n C17 = MICROBIT_ID_IO_P8, // TX\n MIC = MICROBIT_ID_IO_P21 // microphone\n};\n\nenum class PulseValue {\n High = MICROBIT_PIN_EVT_PULSE_HI,\n Low = MICROBIT_PIN_EVT_PULSE_LO\n};\n\nenum class PinPullMode {\n //% block=\"down\"\n PullDown = 0,\n //% block=\"up\"\n PullUp = 1,\n //% block=\"none\"\n PullNone = 2\n};\n\nenum class PinEventType {\n //% block=\"edge\"\n Edge = MICROBIT_PIN_EVENT_ON_EDGE,\n //% block=\"pulse\"\n Pulse = MICROBIT_PIN_EVENT_ON_PULSE,\n //% block=\"touch\"\n Touch = MICROBIT_PIN_EVENT_ON_TOUCH,\n //% block=\"none\"\n None = MICROBIT_PIN_EVENT_NONE\n};\n\nMicroBitPin *getPin(int id) {\n switch (id) {\n case MICROBIT_ID_IO_P0: return &uBit.io.P0;\n case MICROBIT_ID_IO_P1: return &uBit.io.P1;\n case MICROBIT_ID_IO_P2: return &uBit.io.P2;\n case MICROBIT_ID_IO_P3: return &uBit.io.P3;\n case MICROBIT_ID_IO_P4: return &uBit.io.P4;\n case MICROBIT_ID_IO_P5: return &uBit.io.P5;\n case MICROBIT_ID_IO_P6: return &uBit.io.P6;\n case MICROBIT_ID_IO_P7: return &uBit.io.P7;\n case MICROBIT_ID_IO_P8: return &uBit.io.P8;\n case MICROBIT_ID_IO_P9: return &uBit.io.P9;\n case MICROBIT_ID_IO_P10: return &uBit.io.P10;\n case MICROBIT_ID_IO_P11: return &uBit.io.P11;\n case MICROBIT_ID_IO_P12: return &uBit.io.P12;\n case MICROBIT_ID_IO_P13: return &uBit.io.P13;\n case MICROBIT_ID_IO_P14: return &uBit.io.P14;\n case MICROBIT_ID_IO_P15: return &uBit.io.P15;\n case MICROBIT_ID_IO_P16: return &uBit.io.P16;\n case MICROBIT_ID_IO_P19: return &uBit.io.P19;\n case MICROBIT_ID_IO_P20: return &uBit.io.P20;\n case MICROBIT_ID_IO_P21: return &uBit.io.P21;\n default: return NULL;\n }\n}\n\n\nnamespace pins {\n #define PINOP(op) \\\n MicroBitPin *pin = getPin((int)name); \\\n if (!pin) return; \\\n pin->op\n\n #define PINREAD(op) \\\n MicroBitPin *pin = getPin((int)name); \\\n if (!pin) return 0; \\\n return pin->op\n\n\n //%\n MicroBitPin *getPinAddress(int id) {\n return getPin(id);\n }\n\n /**\n * Read the specified pin or connector as either 0 or 1\n * @param name pin to read from\n */\n //% help=pins/digital-read-pin weight=30\n //% blockId=device_get_digital_pin block=\"digital read|pin %name\" blockGap=8\n int digitalReadPin(DigitalPin name) {\n PINREAD(getDigitalValue());\n }\n\n /**\n * Set a pin or connector value to either 0 or 1.\n * @param name pin to write to\n * @param value value to set on the pin, 1 eg,0\n */\n //% help=pins/digital-write-pin weight=29\n //% blockId=device_set_digital_pin block=\"digital write|pin %name|to %value\"\n void digitalWritePin(DigitalPin name, int value) {\n PINOP(setDigitalValue(value));\n }\n\n
"pins.ts": "/**\n * Control currents in Pins for analog/digital signals, servos, i2c, ...\n */\n//% color=#A80000 weight=30 icon=\"\\uf140\"\n//% advanced=true\nnamespace pins {\n /**\n * Re-maps a number from one range to another. That is, a value of ``from low`` would get mapped to ``to low``, a value of ``from high`` to ``to high``, values in-between to values in-between, etc.\n * @param value value to map in ranges\n * @param fromLow the lower bound of the value's current range\n * @param fromHigh the upper bound of the value's current range, eg: 1023\n * @param toLow the lower bound of the value's target range\n * @param toHigh the upper bound of the value's target range, eg: 4\n */\n //% help=pins/map weight=23\n //% blockId=math_map block=\"map %value|from low %fromLow|from high %fromHigh|to low %toLow|to high %toHigh\"\n export function map(value: number, fromLow: number, fromHigh: number, toLow: number, toHigh: number): number {\n return ((value - fromLow) * (toHigh - toLow)) / (fromHigh - fromLow) + toLow;\n }\n\n /**\n * Read one number from 7-bit I2C address.\n */\n //% help=pins/i2c-read-number blockGap=8\n //% blockId=pins_i2c_readnumber block=\"i2c read number|at address %address|of format %format=i2c_sizeof|repeat %repeat\" weight=7\n export function i2cReadNumber(address: number, format: NumberFormat, repeat?: boolean): number {\n let buf = pins.i2cReadBuffer(address, pins.sizeOf(format), repeat)\n return buf.getNumber(format, 0)\n }\n\n /**\n * Write one number to a 7-bit I2C address.\n */\n //% help=pins/i2c-write-number blockGap=8\n //% blockId=i2c_writenumber block=\"i2c write number|at address %address|with value %value|of format %format=i2c_sizeof|repeat %repeat\" weight=6\n export function i2cWriteNumber(address: number, value: number, format: NumberFormat, repeat?: boolean): void {\n let buf = createBuffer(pins.sizeOf(format))\n buf.setNumber(format, 0, value)\n pins.i2cWriteBuffer(address, buf, repeat)\n }\n\n /**\n * Get the size in bytes of specified number format.\n */\n //%\n export function sizeOf(format: NumberFormat) {\n switch (format) {\n case NumberFormat.Int8LE:\n case NumberFormat.UInt8LE:\n case NumberFormat.Int8BE:\n case NumberFormat.UInt8BE:\n return 1;\n case NumberFormat.Int16LE:\n case NumberFormat.UInt16LE:\n case NumberFormat.Int16BE:\n case NumberFormat.UInt16BE:\n return 2;\n case NumberFormat.Int32LE:\n case NumberFormat.Int32BE:\n return 4;\n }\n return 0;\n }\n}\n\n\ninterface Buffer {\n [index: number]: number;\n // rest defined in buffer.cpp\n}\n",
"pxt-core.d.ts": "/// <reference no-default-lib=\"true\"/>\n\ninterface Array<T> {\n /**\n * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n //% shim=Array_::length weight=84\n //% blockId=\"lists_length\" block=\"length of %VALUE\" blockBuiltin=true blockNamespace=\"lists\"\n length: number;\n\n /**\n * Appends new elements to an array.\n * @param items New elements of the Array.\n */\n //% shim=Array_::push weight=75\n //% blockId=\"array_push\" block=\"push into %this|with last item %item\" blockNamespace=\"lists\"\n push(item: T): void;\n\n /**\n * Removes the last element from an array and returns it.\n */\n //% shim=Array_::pop weight=74\n //% blockId=\"array_pop\" block=\"pop last item from %this\" blockNamespace=\"lists\"\n pop(): T;\n\n /**\n * Reverses the elements in an Array. The first array element becomes the last, and the last array element becomes the first.\n */\n //% helper=arrayReverse weight=10\n //% blockId=\"array_reverse\" block=\"reverse %this\" blockNamespace=\"lists\"\n reverse(): void;\n\n /**\n * Removes the first element from an array and returns that element. This method changes the length of the array.\n */\n //% helper=arrayShift weight=70\n //% blockId=\"array_shift\" block=\"shift first item from %this\" blockNamespace=\"lists\"\n shift(): T;\n\n /**\n * Adds one element to the beginning of an array and returns the new length of the array.\n * @param element to insert at the start of the Array.\n */\n //% helper=arrayUnshift weight=69\n //% blockId=\"array_unshift\" block=\"unshift into %this|with first item %item\" blockNamespace=\"lists\"\n //unshift(...values:T[]): number; //rest is not supported in our compiler yet.\n unshift(value:T): number;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array. eg: 0\n * @param end The end of the specified portion of the array. eg: 0\n */\n //% helper=arraySlice weight=41\n //% blockId=\"array_slice\" block=\"slice %this|from %start|to %end\" blockNamespace=\"lists\"\n slice(start: number, end: number): T[];\n\n /**\n * Removes elements from an array.\n * @param start The zero-based location in the array from which to start removing elements. eg: 0\n * @param deleteCount The number of elements to remove. eg: 0\n */\n //% helper=arraySplice weight=40\n splice(start: number, deleteCount: number): void;\n\n /**\n * Sorts the elements of an array in place and returns the array. The sort is not necessarily stable.\n * @param specifies a function that defines the sort order. If omitted, the array is sorted according to the prmitive type\n */\n //% helper=arraySort weight=40\n sort(callbackfn?: (value1: T, value2: T) => number): T[];\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @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.\n */\n //% helper=arrayMap weight=40\n map<U>(callbackfn: (value: T, index: number) => U): U[];\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n */\n //% helper=arrayFilter weight=40\n filter(callbackfn: (value: T, index: number) => boolean): T[];\n\n /**\n * Calls 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.\n * @param callbackfn A function that accepts up to three ar
"pxt-helpers.ts": "type Action = () => void;\n\nnamespace helpers {\n export function arraySplice<T>(arr: T[], start: number, len: number) {\n if (start < 0) {\n return;\n }\n for (let i = 0; i < len; ++i) {\n arr.removeAt(start)\n }\n }\n \n export function arrayReverse<T>(arr: T[]) : void {\n let len = arr.length;\n for (let i = 0; i < len/2; i++)\n {\n swap(arr, i, len - i - 1);\n }\n }\n\n export function arrayShift<T>(arr: T[]) : T {\n return arr.removeAt(0);\n }\n\n/*TODO: Enable this multiple value unshift, after rest is enabled in our compiler.\n export function arrayUnshift<T>(arr: T[], ...values: T[]) : number {\n for(let i = values.length; i > 0; --i) {\n arr.insertAt(0, values[i - 1]);\n }\n return arr.length;\n } \n*/\n export function arrayUnshift<T>(arr: T[], value: T) : number {\n arr.insertAt(0, value);\n return arr.length;\n }\n\n function swap<T>(arr: T[], i : number, j: number) : void {\n let temp : T = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n\n function sortHelper<T>(arr: T[], callbackfn ?: (value1: T, value2: T) => number) : T[] {\n if (arr.length <= 0 || !callbackfn) {\n return arr;\n } \n let len = arr.length; \n // simple selection sort. \n for (let i = 0; i < len - 1; ++i) {\n for (let j = i + 1; j < len; ++j)\n {\n if (callbackfn(arr[i], arr[j]) > 0) {\n swap(arr, i, j);\n }\n }\n }\n return arr;\n }\n\n export function arraySort<T>(arr: T[], callbackfn?: (value1: T, value2: T) => number): T[] {\n if (!callbackfn) {\n //TODO: support native strings and number sorting\n /* callbackfn = function (value1: string, value2: string) : number {\n return value1.compare(value2);\n }*/\n }\n return sortHelper(arr, callbackfn);\n }\n\n export function arrayMap<T, U>(arr: T[], callbackfn: (value: T, index: number) => U): U[] {\n let res: U[] = []\n let len = arr.length // caching this seems to match V8\n for (let i = 0; i < len; ++i) {\n res.push(callbackfn(arr[i], i))\n }\n return res\n }\n\n export function arrayFilter<T>(arr: T[], callbackfn: (value: T, index: number) => boolean): T[] {\n let res: T[] = []\n let len = arr.length\n for (let i = 0; i < len; ++i) {\n let v = arr[i] // need to cache\n if (callbackfn(v, i)) res.push(v)\n }\n return res\n }\n\n export function arrayReduce<T, U>(arr: T[], callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U {\n let len = arr.length\n for (let i = 0; i < len; ++i) {\n initialValue = callbackfn(initialValue, arr[i], i)\n }\n return initialValue\n }\n}\n\nnamespace Math {\n export function clamp(min: number, max: number, value: number): number {\n return Math.min(max, Math.max(min, value));\n }\n\n /**\n * Returns the absolute value of a number (the value without regard to whether it is positive or negative). \n * For example, the absolute value of -5 is the same as the absolute value of 5.\n * @param x A numeric expression for which the absolute value is needed.\n */\n export function abs(x: number): number {\n return x < 0 ? -x : x;\n }\n\n /**\n * Returns the sign of the x, indicating whether x is positive, negative or zero.\n * @param x The numeric expression to test\n */\n export function sign(x: number): number {\n if (x == 0) return 0;\n if (x > 0) return 1;\n return -1;\n }\n\n /**\n * Returns the larger of two supplied numeric expressions. \n */\n export function max(a: number, b: number): number {\n
"pxt.cpp": "#include \"pxt.h\"\n#include <map>\n\nMicroBit uBit;\n\nnamespace pxt {\n int incr(uint32_t e)\n {\n if (e) {\n if (hasVTable(e))\n ((RefObject*)e)->ref();\n else\n ((RefCounted*)e)->incr();\n }\n return e;\n }\n\n void decr(uint32_t e)\n {\n if (e) {\n if (hasVTable(e))\n ((RefObject*)e)->unref();\n else\n ((RefCounted*)e)->decr();\n }\n }\n\n Action mkAction(int reflen, int totallen, int startptr)\n {\n check(0 <= reflen && reflen <= totallen, ERR_SIZE, 1);\n check(reflen <= totallen && totallen <= 255, ERR_SIZE, 2);\n check(bytecode[startptr] == 0xffff, ERR_INVALID_BINARY_HEADER, 3);\n check(bytecode[startptr + 1] == 0, ERR_INVALID_BINARY_HEADER, 4);\n\n uint32_t tmp = (uint32_t)&bytecode[startptr];\n\n if (totallen == 0) {\n return tmp; // no closure needed\n }\n\n void *ptr = ::operator new(sizeof(RefAction) + totallen * sizeof(uint32_t));\n RefAction *r = new (ptr) RefAction();\n r->len = totallen;\n r->reflen = reflen;\n r->func = (ActionCB)((tmp + 4) | 1);\n memset(r->fields, 0, r->len * sizeof(uint32_t));\n\n return (Action)r;\n }\n\n uint32_t runAction3(Action a, int arg0, int arg1, int arg2)\n {\n if (hasVTable(a))\n return ((RefAction*)a)->runCore(arg0, arg1, arg2);\n else {\n check(*(uint16_t*)a == 0xffff, ERR_INVALID_BINARY_HEADER, 4);\n return ((ActionCB)((a + 4) | 1))(NULL, arg0, arg1, arg2);\n }\n }\n\n uint32_t runAction2(Action a, int arg0, int arg1)\n {\n return runAction3(a, arg0, arg1, 0);\n }\n\n uint32_t runAction1(Action a, int arg0)\n {\n return runAction3(a, arg0, 0, 0);\n }\n\n uint32_t runAction0(Action a)\n {\n return runAction3(a, 0, 0, 0);\n }\n\n RefRecord* mkClassInstance(int vtableOffset)\n {\n VTable *vtable = (VTable*)&bytecode[vtableOffset];\n\n intcheck(vtable->methods[0] == &RefRecord_destroy, ERR_SIZE, 3);\n intcheck(vtable->methods[1] == &RefRecord_print, ERR_SIZE, 4);\n\n void *ptr = ::operator new(vtable->numbytes);\n RefRecord *r = new (ptr) RefRecord(PXT_VTABLE_TO_INT(vtable));\n memset(r->fields, 0, vtable->numbytes - sizeof(RefRecord));\n return r;\n }\n\n uint32_t RefRecord::ld(int idx)\n {\n //intcheck((reflen == 255 ? 0 : reflen) <= idx && idx < len, ERR_OUT_OF_BOUNDS, 1);\n return fields[idx];\n }\n\n uint32_t RefRecord::ldref(int idx)\n {\n //printf(\"LD %p len=%d reflen=%d idx=%d\\n\", this, len, reflen, idx);\n //intcheck(0 <= idx && idx < reflen, ERR_OUT_OF_BOUNDS, 2);\n uint32_t tmp = fields[idx];\n incr(tmp);\n return tmp;\n }\n\n void RefRecord::st(int idx, uint32_t v)\n {\n //intcheck((reflen == 255 ? 0 : reflen) <= idx && idx < len, ERR_OUT_OF_BOUNDS, 3);\n fields[idx] = v;\n }\n\n void RefRecord::stref(int idx, uint32_t v)\n {\n //printf(\"ST %p len=%d reflen=%d idx=%d\\n\", this, len, reflen, idx);\n //intcheck(0 <= idx && idx < reflen, ERR_OUT_OF_BOUNDS, 4);\n decr(fields[idx]);\n fields[idx] = v;\n }\n\n void RefObject::destroy() {\n ((RefObjectMethod)getVTable()->methods[0])(this);\n }\n\n void RefObject::print() {\n ((RefObjectMethod)getVTable()->methods[1])(this);\n }\n\n void RefRecord_destroy(RefRecord *r) {\n auto tbl = r->getVTable();\n uint8_t *refmask = (uint8_t*)&tbl->methods[tbl->userdata & 0xff];\n int len = (tbl->numbytes >> 2) - 1;\n for (int i = 0; i < len; ++i) {\n if (refmask[i]) decr(r->fields[i]);\n r->fields[i] = 0;\n }\n //RefRecord is allocated using placement new\n r->~RefRecord();\n ::operator delete(r);\n }\n\n void RefRecord_print(RefRecord *r)\n {\n printf(\"RefRecord %p r=%d size=%d bytes\\n\", r, r->refcnt, r->getVTable()->numbytes);\n }\n\n uint32_t Segment::get(uint32_t i)\n
"pxt.h": "#ifndef __PXT_H\n#define __PXT_H\n\n//#define DEBUG_MEMLEAKS 1\n\n#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n\n#include \"MicroBit.h\"\n#include \"MicroBitImage.h\"\n#include \"ManagedString.h\"\n#include \"ManagedType.h\"\n#include \"ManagedBuffer.h\"\n\n#define printf(...) uBit.serial.printf(__VA_ARGS__)\n// #define printf(...)\n\n#define intcheck(...) check(__VA_ARGS__)\n//#define intcheck(...) do {} while (0)\n\n#include <stdio.h>\n#include <string.h>\n#include <vector>\n#include <stdint.h>\n\n#ifdef DEBUG_MEMLEAKS\n#include <set>\n#endif\n\nextern MicroBit uBit;\n\nnamespace pxt {\n typedef uint32_t Action;\n typedef uint32_t ImageLiteral;\n\n\n typedef enum {\n ERR_INVALID_BINARY_HEADER = 5,\n ERR_OUT_OF_BOUNDS = 8,\n ERR_REF_DELETED = 7,\n ERR_SIZE = 9,\n } ERROR;\n\n extern const uint32_t functionsAndBytecode[];\n extern uint32_t *globals;\n extern uint16_t *bytecode;\n class RefRecord;\n\n // Utility functions\n extern MicroBitEvent lastEvent;\n void registerWithDal(int id, int event, Action a);\n void runInBackground(Action a);\n uint32_t runAction3(Action a, int arg0, int arg1, int arg2);\n uint32_t runAction2(Action a, int arg0, int arg1);\n uint32_t runAction1(Action a, int arg0);\n uint32_t runAction0(Action a);\n Action mkAction(int reflen, int totallen, int startptr);\n void error(ERROR code, int subcode = 0);\n void exec_binary(uint16_t *pc);\n void start();\n void debugMemLeaks();\n // allocate [sz] words and clear them\n uint32_t *allocate(uint16_t sz);\n int templateHash();\n int programHash();\n uint32_t programSize();\n uint32_t afterProgramPage(); \n int getNumGlobals();\n RefRecord* mkClassInstance(int vtableOffset);\n\n // The standard calling convention is:\n // - when a pointer is loaded from a local/global/field etc, and incr()ed\n // (in other words, its presence on stack counts as a reference)\n // - after a function call, all pointers are popped off the stack and decr()ed\n // This does not apply to the RefRecord and st/ld(ref) methods - they unref()\n // the RefRecord* this.\n int incr(uint32_t e);\n void decr(uint32_t e);\n\n inline void *ptrOfLiteral(int offset)\n {\n return &bytecode[offset];\n }\n\n inline ImageData* imageBytes(int offset)\n {\n return (ImageData*)(void*)&bytecode[offset];\n }\n\n // Checks if object has a VTable, or if its RefCounted* from the runtime.\n inline bool hasVTable(uint32_t e)\n {\n return (*((uint32_t*)e) & 1) == 0;\n }\n\n inline void check(int cond, ERROR code, int subcode = 0)\n {\n if (!cond) error(code, subcode);\n }\n\n\n class RefObject;\n#ifdef DEBUG_MEMLEAKS\n extern std::set<RefObject*> allptrs;\n#endif\n\n typedef void (*RefObjectMethod)(RefObject *self);\n typedef void *PVoid;\n typedef void **PPVoid;\n\n const PPVoid RefMapMarker = (PPVoid)(void*)43;\n\n struct VTable {\n uint16_t numbytes; // in the entire object, including the vtable pointer\n uint16_t userdata;\n PVoid *ifaceTable;\n PVoid methods[2]; // we only use up to two methods here; pxt will generate more\n // refmask sits at &methods[nummethods]\n };\n\n const int vtableShift = 2;\n\n // A base abstract class for ref-counted objects.\n class RefObject\n {\n public:\n uint16_t refcnt;\n uint16_t vtable;\n\n RefObject(uint16_t vt)\n {\n refcnt = 2;\n vtable = vt;\n#ifdef DEBUG_MEMLEAKS\n allptrs.insert(this);\n#endif\n }\n\n inline VTable *getVTable() {\n return (VTable*)(vtable << vtableShift);\n }\n\n void destroy();\n void print();\n\n // Call to disable pointer tracking on the current instance (in destructor or some other hack)\n inline void untrack() {\n#ifdef DEBUG_MEMLEAKS\n allptrs.erase(this);\n#endif\n }\n\n // Increment/decrement the ref-count. Decrementing to zero deletes the current object.\n inline void ref()\n {\n check(refcnt > 0, ERR_REF_DELETED);\n //printf(\"INCR \"); this->print();\n refcnt += 2;\n }\n\n inline void unref()\n {\n
"pxt.json": "{\n \"name\": \"core\",\n \"description\": \"The microbit core library\",\n \"files\": [\n \"README.md\",\n \"ManagedBuffer.cpp\",\n \"ManagedBuffer.h\",\n \"pxt.cpp\",\n \"pxt.h\",\n \"dal.d.ts\",\n \"enums.d.ts\",\n \"shims.d.ts\",\n \"pxt-core.d.ts\",\n \"core.cpp\",\n \"pxt-helpers.ts\",\n \"helpers.ts\",\n \"images.cpp\",\n \"basic.cpp\",\n \"basic.ts\",\n \"input.cpp\",\n \"input.ts\",\n \"control.ts\",\n \"control.cpp\",\n \"game.ts\",\n \"led.cpp\",\n \"led.ts\",\n \"motors.cpp\",\n \"music.cpp\",\n \"music.ts\",\n \"pins.cpp\",\n \"pins.ts\",\n \"serial.cpp\",\n \"serial.ts\",\n \"icons.ts\",\n \"buffer.cpp\",\n \"pxtparts.json\",\n \"parts/speaker.svg\",\n \"parts/headphone.svg\",\n \"parts/dcmotor.svg\",\n \"_locales/de/core-jsdoc-strings.json\",\n \"_locales/de/core-strings.json\"\n ],\n \"public\": true,\n \"dependencies\": {},\n \"yotta\": {\n \"optionalConfig\": {\n \"microbit-dal\": {\n \"bluetooth\": {\n \"enabled\": 0\n }\n }\n }\n }\n}",
"pxtparts.json": "{ \n \"buttonpair\": {\n \"simulationBehavior\": \"buttonpair\",\n \"visual\": {\n \"builtIn\": \"buttonpair\",\n \"width\": 75,\n \"height\": 45,\n \"pinDistance\": 15,\n \"pinLocations\": [\n {\"x\": 0, \"y\": 0},\n {\"x\": 30, \"y\": 45},\n {\"x\": 45, \"y\": 0},\n {\"x\": 75, \"y\": 45}\n ]\n },\n \"numberOfPins\": 4,\n \"pinDefinitions\": [\n {\"target\": \"P14\", \"style\": \"male\", \"orientation\": \"-Z\"},\n {\"target\": \"ground\", \"style\": \"male\", \"orientation\": \"-Z\"},\n {\"target\": \"P15\", \"style\": \"male\", \"orientation\": \"-Z\"},\n {\"target\": \"ground\", \"style\": \"male\", \"orientation\": \"-Z\"}\n ],\n \"instantiation\": {\n \"kind\": \"singleton\"\n },\n \"assembly\": [\n {\"part\": true},\n {\"pinIndices\": [0, 1]},\n {\"pinIndices\": [2, 3]}\n ]\n },\n \"microservo\": {\n \"simulationBehavior\": \"microservo\",\n \"visual\": {\n \"builtIn\": \"microservo\",\n \"width\": 74.85,\n \"height\": 200,\n \"pinDistance\": 10,\n \"pinLocations\": [\n {\"x\": 30, \"y\": 5},\n {\"x\": 37, \"y\": 5},\n {\"x\": 45, \"y\": 5}\n ]\n },\n \"numberOfPins\": 3,\n \"pinDefinitions\": [\n {\"target\": {\"pinInstantiationIdx\": 0}, \"style\": \"croc\", \"orientation\": \"+Z\"},\n {\"target\": \"threeVolt\", \"style\": \"croc\", \"orientation\": \"+Z\"},\n {\"target\": \"ground\", \"style\": \"croc\", \"orientation\": \"+Z\"}\n ],\n \"instantiation\": {\n \"kind\": \"function\",\n \"fullyQualifiedName\": \"pins.servoWritePin\",\n \"argumentRoles\": [\n {\"pinInstantiationIdx\": 0, \"partParameter\": \"name\"}\n ]\n },\n \"assembly\": [\n {\"part\": true, \"pinIndices\": [2]},\n {\"pinIndices\": [0, 1]}\n ]\n },\n \"neopixel\": {\n \"simulationBehavior\": \"neopixel\",\n \"visual\": {\n \"builtIn\": \"neopixel\",\n \"width\": 58,\n \"height\": 113,\n \"pinDistance\": 9,\n \"pinLocations\": [\n {\"x\": 10, \"y\": 0},\n {\"x\": 19, \"y\": 0},\n {\"x\": 28, \"y\": 0}\n ]\n },\n \"numberOfPins\": 3,\n \"pinDefinitions\": [\n {\"target\": {\"pinInstantiationIdx\": 0}, \"style\": \"solder\", \"orientation\": \"+Z\"},\n {\"target\": \"threeVolt\", \"style\": \"solder\", \"orientation\": \"+Z\"},\n {\"target\": \"ground\", \"style\": \"solder\", \"orientation\": \"+Z\"}\n ],\n \"instantiation\": {\n \"kind\": \"function\",\n \"fullyQualifiedName\": \"neopixel.create\",\n \"argumentRoles\": [\n {\"pinInstantiationIdx\": 0, \"partParameter\": \"pin\"},\n {\"partParameter\": \"mode\"}\n ]\n },\n \"assembly\": [\n {\"part\": true, \"pinIndices\": [2]},\n {\"pinIndices\": [0, 1]}\n ]\n },\n \"ledmatrix\": {\n \"visual\": {\n \"builtIn\": \"ledmatrix\",\n \"width\": 105,\n \"height\": 105,\n \"pinDistance\": 15,\n \"pinLocations\": [\n {\"x\": 0, \"y\": 0},\n {\"x\": 15, \"y\": 0},\n {\"x\": 30, \"y\": 0},\n {\"x\": 45, \"y\": 0},\n {\"x\": 105, \"y\": 105},\n {\"x\": 0, \"y\": 105},\n {\"x\": 15, \"y\": 105},\n {\"x\": 30, \"y\": 105},\n {\"x\": 45, \"y\": 105},\n {\"x\": 60, \"y\": 0}\n
"serial.cpp": "#include \"pxt.h\"\n\nenum SerialPin {\n C16 = MICROBIT_ID_IO_P2,\n C17 = MICROBIT_ID_IO_P8,\n P0 = MICROBIT_ID_IO_P12,\n P1 = MICROBIT_ID_IO_P0,\n P2 = MICROBIT_ID_IO_P1,\n P3 = MICROBIT_ID_IO_P16,\n};\n\nenum BaudRate {\n //% block=115200\n BaudRate115200 = 115200,\n //% block=57600\n BaudRate56700 = 57600,\n //% block=9600\n BaudRate9600 = 9600\n};\n\nenum Delimiters {\n //% block=\"new line\"\n NewLine = 1,\n //% block=\",\"\n Comma = 2,\n //% block=\"$\"\n Dollar = 3,\n //% block=\":\"\n Colon = 4,\n //% block=\".\"\n Fullstop = 5,\n //% block=\"#\"\n Hash = 6,\n};\n\n//% weight=2 color=30\n//% advanced=true\nnamespace serial {\n // note that at least one // followed by % is needed per declaration!\n\n /**\n * Reads a line of text from the serial port and returns the buffer when the delimiter is met.\n * @param delimiter text delimiter that separates each text chunk\n */\n //% help=serial/read-until\n //% blockId=serial_read_until block=\"serial|read until %delimiter=serial_delimiter_conv\"\n //% weight=19\n StringData* readUntil(StringData* delimiter) {\n return uBit.serial.readUntil(ManagedString(delimiter)).leakData();\n }\n\n /**\n * Reads the buffered received data as a string\n */\n //% blockId=serial_read_buffer block=\"serial|read string\"\n //% weight=18\n StringData* readString() {\n int n = uBit.serial.getRxBufferSize();\n if (n == 0) return ManagedString(\"\").leakData();\n return ManagedString(uBit.serial.read(n, MicroBitSerialMode::ASYNC)).leakData();\n }\n\n /**\n * Registers an event to be fired when one of the delimiter is matched.\n * @param delimiters the characters to match received characters against.\n */\n //% help=serial/on-data-received\n //% weight=18 blockId=serial_on_data_received block=\"serial|on data received %delimiters=serial_delimiter_conv\"\n void onDataReceived(StringData* delimiters, Action body) {\n uBit.serial.eventOn(ManagedString(delimiters));\n registerWithDal(MICROBIT_ID_SERIAL, MICROBIT_SERIAL_EVT_DELIM_MATCH, body);\n // lazy initialization of serial buffers\n uBit.serial.read(MicroBitSerialMode::ASYNC);\n }\n\n /**\n * Sends a piece of text through Serial connection.\n */\n //% help=serial/write-string\n //% weight=87\n //% blockId=serial_writestring block=\"serial|write string %text\"\n void writeString(StringData *text) {\n uBit.serial.send(ManagedString(text));\n }\n\n /**\n * Dynamically configuring the serial instance to use pins other than USBTX and USBRX.\n * @param tx the new transmission pins, eg: SerialPin.P0\n * @param rx the new reception pin, eg: SerialPin.P1\n * @param rate the new baud rate. eg: 115200\n */\n //% weight=10\n //% help=serial/redirect-to\n //% blockId=serial_redirect block=\"serial|redirect to|TX %tx|RX %rx|at baud rate %rate\"\n //% blockExternalInputs=1\n void redirect(SerialPin tx, SerialPin rx, BaudRate rate) {\n MicroBitPin* txp = getPin(tx); if (!tx) return;\n MicroBitPin* rxp = getPin(rx); if (!rx) return;\n\n uBit.serial.redirect(txp->name, rxp->name);\n uBit.serial.baud((int)rate);\n }\n}\n",
"serial.ts": "/**\n * Reading and writing data over a serial connection.\n */\n//% weight=2 color=#002050 icon=\"\\uf287\"\n//% advanced=true\nnamespace serial {\n /**\n * Prints a line of text to the serial\n * @param value to send over serial\n */\n //% weight=90\n //% help=serial/write-line blockGap=8\n //% blockId=serial_writeline block=\"serial|write line %text\"\n export function writeLine(text: string): void {\n writeString(text + \"\\r\\n\");\n }\n\n /**\n * Prints a numeric value to the serial\n */\n //% help=serial/write-number\n //% weight=89 blockGap=8\n //% blockId=serial_writenumber block=\"serial|write number %value\"\n export function writeNumber(value: number): void {\n writeString(value.toString());\n }\n\n /**\n * Writes a ``name: value`` pair line to the serial.\n * @param name name of the value stream, eg: x\n * @param value to write\n */\n //% weight=88 blockGap=8\n //% help=serial/write-value\n //% blockId=serial_writevalue block=\"serial|write value %name|= %value\"\n export function writeValue(name: string, value: number): void {\n writeString(name + \":\" + value + \"\\r\\n\");\n }\n\n /**\n * Reads a line of text from the serial port.\n */\n //% help=serial/read-line\n //% blockId=serial_read_line block=\"serial|read line\"\n //% weight=20 blockGap=8\n export function readLine(): string {\n return serial.readUntil(delimiters(Delimiters.NewLine));\n }\n\n /**\n * Returns the delimiter corresponding string\n */\n //% blockId=\"serial_delimiter_conv\" block=\"%del\"\n //% weight=1 blockHidden=true\n export function delimiters(del: Delimiters): string {\n // even though it might not look like, this is more\n // (memory) efficient than the C++ implementation, because the\n // strings are statically allocated and take no RAM \n switch (del) {\n case Delimiters.NewLine: return \"\\n\"\n case Delimiters.Comma: return \",\"\n case Delimiters.Dollar: return \"$\"\n case Delimiters.Colon: return \":\"\n case Delimiters.Fullstop: return \".\"\n case Delimiters.Hash: return \"#\"\n default: return \"\\n\"\n }\n }\n}\n",
"shims.d.ts": "// Auto-generated. Do not edit.\n\n\n /**\n * Creation, manipulation and display of LED images.\n */\n //% color=#5C2D91 weight=31 icon=\"\\uf03e\"\n //% advanced=true\ndeclare namespace images {\n\n /**\n * Creates an image that fits on the LED screen.\n */\n //% weight=75 help=images/create-image\n //% blockId=device_build_image block=\"create image\"\n //% parts=\"ledmatrix\" imageLiteral=1 shim=images::createImage\n function createImage(leds: string): Image;\n\n /**\n * Creates an image with 2 frames.\n */\n //% weight=74 help=images/create-big-image\n //% blockId=device_build_big_image block=\"create big image\" imageLiteral=2\n //% parts=\"ledmatrix\" shim=images::createBigImage\n function createBigImage(leds: string): Image;\n}\n\n\ndeclare interface Image {\n /**\n * Plots the image at a given column to the screen\n */\n //% help=images/plot-image\n //% parts=\"ledmatrix\" xOffset.defl=0 shim=ImageMethods::plotImage\n plotImage(xOffset?: number): void;\n\n /**\n * Shows an frame from the image at offset ``x offset``.\n * @param xOffset column index to start displaying the image\n */\n //% help=images/show-image weight=80 blockNamespace=images\n //% blockId=device_show_image_offset block=\"show image %sprite|at offset %offset\" blockGap=8\n //% parts=\"ledmatrix\" async interval.defl=400 shim=ImageMethods::showImage\n showImage(xOffset: number, interval?: number): void;\n\n /**\n * Draws the ``index``-th frame of the image on the screen.\n * @param xOffset column index to start displaying the image\n */\n //% help=images/plot-frame weight=80\n //% parts=\"ledmatrix\" shim=ImageMethods::plotFrame\n plotFrame(xOffset: number): void;\n\n /**\n * Scrolls an image .\n * @param frameOffset x offset moved on each animation step, eg: 1, 2, 5\n * @param interval time between each animation step in milli seconds, eg: 200\n */\n //% help=images/show-image weight=79 async blockNamespace=images\n //% blockId=device_scroll_image block=\"scroll image %sprite|with offset %frameoffset|and interval (ms) %delay\" blockGap=8\n //% parts=\"ledmatrix\" shim=ImageMethods::scrollImage\n scrollImage(frameOffset: number, interval: number): void;\n\n /**\n * Sets all pixels off.\n */\n //% help=images/clear\n //% parts=\"ledmatrix\" shim=ImageMethods::clear\n clear(): void;\n\n /**\n * Sets a specific pixel brightness at a given position\n */\n //%\n //% parts=\"ledmatrix\" shim=ImageMethods::setPixelBrightness\n setPixelBrightness(x: number, y: number, value: number): void;\n\n /**\n * Gets the pixel brightness ([0..255]) at a given position\n */\n //%\n //% parts=\"ledmatrix\" shim=ImageMethods::pixelBrightness\n pixelBrightness(x: number, y: number): number;\n\n /**\n * Gets the width in columns\n */\n //% help=functions/width shim=ImageMethods::width\n width(): number;\n\n /**\n * Gets the height in rows (always 5)\n */\n //% shim=ImageMethods::height\n height(): number;\n\n /**\n * Set a pixel state at position ``(x,y)``\n * @param x TODO\n * @param y TODO\n * @param value TODO\n */\n //% help=images/set-pixel\n //% parts=\"ledmatrix\" shim=ImageMethods::setPixel\n setPixel(x: number, y: number, value: boolean): void;\n\n /**\n * Get the pixel state at position ``(x,y)``\n * @param x TODO\n * @param y TODO\n */\n //% help=images/pixel\n //% parts=\"ledmatrix\" shim=ImageMethods::pixel\n pixel(x: number, y: number): boolean;\n\n /**\n * Shows a particular frame of the image strip.\n * @param frame TODO\n */\n //% weight=70 help=images/show-frame\n //% parts=\"ledmatrix\" interval.defl=400 shim=ImageMethods::showFrame\n showFrame(frame: number, interval?: number): void;\n}\n\n\n /**\n * Provides access to basic micro:bit functionality.\n */\n //% color=#54C9C9 weigh
},
"radio": {
"README.md": "# radio\n\nThe radio library.\n\n",
"_locales/de/radio-jsdoc-strings.json": "{\n \"radio\": \"Daten mithilfe von Funk-Paketen übertragen\",\n \"radio.onDataPacketReceived\": \"Registriert Funktionen, die ausgeführt werden, wenn das Radio ein Datenpaket empfängt. Entnimmt das empfangene Paket aus der Warteschlange des Radios.\",\n \"radio.onDataReceived\": \"Registriert Code der ausgeführt wird, wenn ein Paket über Funk empfangen wird.\",\n \"radio.receiveNumber\": \"Liest das nächste Paket aus der Funk-Warteschlange und gibt die Paketnummer oder 0 aus, wenn das Paket keine Nummer enthält.\",\n \"radio.receiveString\": \"Liest das nächste Paket aus der Funk-Warteschlange und gibt die enthaltene Zeichenfolge oder die leere Zeichenfolge aus, wenn das Paket keine Zeichenfolge enthält.\",\n \"radio.receivedNumber\": \"Extrahiert eine Zahl aus dem Inhalt des letzten Datenpakets, welches aus der Warteschlange des Radios (via ``Zahl empfangen``, ``Zeichenkette empfangen``, etc) entnommen wurde oder eine 0, wenn das Paket keine Zahl enthält.\",\n \"radio.receivedSerial\": \"Extrahiert die Seriennummer des Calliope mini Senders aus dem Inhalt des letzten Datenpakets, welches aus der Warteschlange des Radios entnommen wurde oder eine 0, wenn der Absender keine Seriennummer gesendet hat.\",\n \"radio.receivedSignalStrength\": \"Ruft den empfangenen Signalstärkeindikator (RSSI) aus dem letzten Paket aus der Funk-Warteschlange aus (via ``receiveNumber``, ``receiveString``, etc). Wird im Simulator nicht unterstützt.\\nnamespace=radio\",\n \"radio.receivedString\": \"Extrahiert die Zeichenkette aus dem Inhalt des letzten Datenpakets, welches aus der Warteschlange des Radios (via ``Zahl empfangen``, ``Zeichenkette empfangen``, etc) entnommen wurde oder eine leere Zeichenkette, wenn das Paket keine Zeichenkette enthält.\",\n \"radio.receivedTime\": \"Extrahiert die Systemzeit des Absenders aus dem Inhalt des letzten Datenpakets, welches aus der Warteschlange des Radios (via ``Zahl empfangen``, ``Zeichenkette empfangen``, etc) entnommen wurde.\",\n \"radio.sendNumber\": \"Überträgt eine Nummer über Funk an jeden angeschlossenen mini in der Gruppe.\",\n \"radio.sendString\": \"Überträgt eine Zeichenfolge über Funk mit Seriennummer des Geräts und Laufzeit an jeden angeschlossenen mini in der Gruppe.\",\n \"radio.sendValue\": \"Sendet ein Name / Wert-Paar zusammen mit der Seriennummer des Geräts und die Laufzeit auf alle angeschlossenen minis in der Gruppe.\",\n \"radio.sendValue|param|value\": \"der numerische Wert\",\n \"radio.setGroup\": \"Setzt die Gruppen-ID für Funkverbindungen. Ein mini kann nur ein Gruppen-ID hören.\\nDie Gruppen-ID zwischen liegt zwischen 0 und 255, z.B. 1\",\n \"radio.setTransmitPower\": \"Ändere die Ausgabeleistung des Senders auf den angegebenen Wert.\",\n \"radio.setTransmitPower|param|power\": \"ein Wert im Bereich 0.. 7, wo 0 die niedrigste Leistung und 7 ist ist die höchste. z.B. 7\",\n \"radio.setTransmitSerialNumber\": \"Stelle den Dunk so ein, dass die Seriennummer in jeder Nachricht übertragen wird.\",\n \"radio.setTransmitSerialNumber|param|transmit\": \"Wert, der anzeigt, ob die Seriennummer übertragen wird, z.B. wahr\",\n \"radio.writeReceivedPacketToSerial\": \"Schreibt das letzte empfangene Paket als JSON auf Seriell. Sollte in einem ´´onDataPacketReceived``-Callback aufgerufen werden.\",\n \"radio.writeValueToSerial\": \"Liest das nächste Paket aus der Funk-Warteschlange und schreibt dieses als JSON auf Seriell.\"\n}",
"_locales/de/radio-strings.json": "{\n \"radio.onDataPacketReceived|block\": \"wenn Datenpaket empfangen\",\n \"radio.onDataReceived|block\": \"Funk auf empfangenen Daten\",\n \"radio.receiveNumber|block\": \"empfange Nummer über Funk\",\n \"radio.receiveString|block\": \"empfange Zeichenfolge über Funk\",\n \"radio.receivedSignalStrength|block\": \"über Funk empfangene Signalstärke\",\n \"radio.sendNumber|block\": \"sende Nummer %value über Funk\",\n \"radio.sendString|block\": \"sende Zeichenfolge %msg über Funk\",\n \"radio.sendValue|block\": \"schicke |Wert %name|= %value über Funk\",\n \"radio.setGroup|block\": \"setze Gruppe %ID über Funk\",\n \"radio.setTransmitPower|block\": \"setze Übertragungsstärke %power über Funk\",\n \"radio.setTransmitSerialNumber|block\": \"setze Übertragungsseriennummer %transmit über Funk\",\n \"radio.writeReceivedPacketToSerial|block\": \"schreibe das über Funk übertragene Paket auf Seriell\",\n \"radio.writeValueToSerial|block\": \"schreibe Wert über Funk auf Seriell\",\n \"radio|block\": \"Funk\",\n \"{id:category}Radio\": \"Funk\"\n}",
"enums.d.ts": "// Auto-generated. Do not edit.\ndeclare namespace radio {\n}\n\n// Auto-generated. Do not edit. Really.\n",
"pxt.json": "{\n \"name\": \"radio\",\n \"description\": \"The radio services\",\n \"files\": [\n \"README.md\",\n \"shims.d.ts\",\n \"enums.d.ts\",\n \"radio.cpp\",\n \"radio.ts\",\n \"_locales/de/radio-jsdoc-strings.json\",\n \"_locales/de/radio-strings.json\"\n ],\n \"public\": true,\n \"dependencies\": {\n \"core\": \"*\"\n },\n \"yotta\": {\n \"config\": {\n \"microbit-dal\": {\n \"bluetooth\": {\n \"enabled\": 0\n }\n }\n }\n }\n}",
"radio.cpp": "#include \"pxt.h\"\n\nusing namespace pxt;\n\n#define MAX_FIELD_NAME_LENGTH 12\n#define MAX_PAYLOAD_LENGTH 20\n#define PACKET_PREFIX_LENGTH 9\n#define VALUE_PACKET_NAME_LEN_OFFSET 13\n\n\n// Packet Spec:\n// | 0 | 1 ... 4 | 5 ... 8 | 9 ... 28\n// ----------------------------------------------------------------\n// | packet type | system time | serial number | payload\n//\n// Serial number defaults to 0 unless enabled by user\n\n// payload: number (9 ... 12)\n#define PACKET_TYPE_NUMBER 0\n\n// payload: number (9 ... 12), name length (13), name (14 ... 26)\n#define PACKET_TYPE_VALUE 1\n\n// payload: string length (9), string (10 ... 28)\n#define PACKET_TYPE_STRING 2\n\n//% color=270 weight=34\nnamespace radio {\n\n // -------------------------------------------------------------------------\n // Radio\n // -------------------------------------------------------------------------\n bool radioEnabled = false;\n bool transmitSerialNumber = false;\n\n PacketBuffer packet;\n\n uint8_t type;\n uint32_t time;\n uint32_t serial;\n int value;\n StringData* msg;\n\n int radioEnable() {\n int r = uBit.radio.enable();\n if (r != MICROBIT_OK) {\n uBit.panic(43);\n return r;\n }\n if (!radioEnabled) {\n uBit.radio.setGroup(pxt::programHash());\n radioEnabled = true;\n }\n return r;\n }\n\n void broadcastMessage(int message) {\n if (radioEnable() != MICROBIT_OK) return;\n uBit.radio.event.eventReceived(MicroBitEvent(MES_BROADCAST_GENERAL_ID, message, CREATE_ONLY));\n }\n\n void onBroadcastMessageReceived(int message, Action f) {\n if (radioEnable() != MICROBIT_OK) return;\n registerWithDal(MES_BROADCAST_GENERAL_ID, message, f);\n }\n\n void setPacketPrefix(uint8_t* buf, int type) {\n // prefix: type (0), time (1..4), serial (5..8)\n uint32_t t = system_timer_current_time();\n uint32_t sn = transmitSerialNumber ? microbit_serial_number() : 0;\n\n buf[0] = (uint8_t) type;\n memcpy(buf + 1, &t, 4);\n memcpy(buf + 5, &sn, 4);\n }\n\n uint8_t copyStringValue(uint8_t* buf, StringData* data, uint8_t maxLength) {\n ManagedString s(data);\n uint8_t len = min(maxLength, s.length());\n\n // One byte for length of the string\n buf[0] = len;\n\n if (len > 0) {\n memcpy(buf + 1, s.toCharArray(), len);\n }\n return len + 1;\n }\n\n StringData* getStringValue(uint8_t* buf, uint8_t maxLength) {\n // First byte is the string length\n uint8_t len = min(maxLength, buf[0]);\n\n if (len) {\n char name[maxLength + 1];\n memcpy(name, buf + 1, len);\n name[len] = 0;\n return ManagedString(name).leakData();\n }\n return ManagedString().leakData();\n }\n\n void writePacketAsJSON(uint8_t tp, int v, int s, int t, StringData* m) {\n // Convert the packet to JSON and send over serial\n uBit.serial.send(\"{\");\n uBit.serial.send(\"\\\"t\\\":\");\n uBit.serial.send(t);\n uBit.serial.send(\",\\\"s\\\":\");\n uBit.serial.send(s);\n if (tp == PACKET_TYPE_STRING || tp == PACKET_TYPE_VALUE) {\n uBit.serial.send(\",\\\"n\\\":\\\"\");\n uBit.serial.send(m);\n uBit.serial.send(\"\\\"\");\n }\n if (tp == PACKET_TYPE_NUMBER || tp == PACKET_TYPE_VALUE) {\n uBit.serial.send(\",\\\"v\\\":\");\n uBit.serial.send(v);\n }\n uBit.serial.send(\"}\\r\\n\");\n }\n\n /**\n * Takes a packet from the micro:bit radio queue.\n * @param writeToSerial if true, write the received packet to serial without updating the global packet;\n if false, update the global packet instead\n */\n void receivePacket(bool writeToSerial) {\n PacketBuffer p = uBit.radio.datagram.recv();\n\n uint8_t* buf =
"radio.ts": "/**\n * Communicate data using radio packets\n */\n//% color=#E3008C weight=34 icon=\"\\uf012\"\nnamespace radio {\n export class Packet {\n /**\n * The number payload if a number was sent in this packet (via ``sendNumber()`` or ``sendValue()``)\n * or 0 if this packet did not contain a number.\n */\n public receivedNumber: number;\n /**\n * The string payload if a string was sent in this packet (via ``sendString()`` or ``sendValue()``)\n * or the empty string if this packet did not contain a string.\n */\n public receivedString: string;\n /**\n * The system time of the sender of the packet at the time the packet was sent.\n */\n public time: number;\n /**\n * The serial number of the sender of the packet or 0 if the sender did not sent their serial number.\n */\n public serial: number;\n /**\n * The received signal strength indicator (RSSI) of the packet.\n */\n public signal: number;\n }\n\n /**\n * Registers code to run when the radio receives a packet. Also takes the\n * received packet from the radio queue.\n */\n //% help=radio/on-data-packet-received\n //% mutate=objectdestructuring\n //% mutateText=Packet\n //% mutateDefaults=\"receivedNumber;receivedString:name,receivedNumber:value;receivedString\"\n //% blockId=radio_on_packet block=\"on radio received\" blockGap=8\n export function onDataPacketReceived(cb: (packet: Packet) => void) {\n onDataReceived(() => {\n receiveNumber();\n const packet = new Packet();\n packet.receivedNumber = receivedNumber();\n packet.time = receivedTime();\n packet.serial = receivedSerial();\n packet.receivedString = receivedString();\n packet.signal = receivedSignalStrength();\n cb(packet)\n });\n }\n}\n",
"shims.d.ts": "// Auto-generated. Do not edit.\n\n\n\n //% color=270 weight=34\ndeclare namespace radio {\n\n /**\n * Broadcasts a number over radio to any connected micro:bit in the group.\n */\n //% help=radio/send-number\n //% weight=60\n //% blockId=radio_datagram_send block=\"radio send number %value\" blockGap=8 shim=radio::sendNumber\n function sendNumber(value: number): void;\n\n /**\n * Broadcasts a name / value pair along with the device serial number\n * and running time to any connected micro:bit in the group.\n * @param name the field name (max 12 characters), eg: \"name\"\n * @param value the numberic value\n */\n //% help=radio/send-value\n //% weight=59\n //% blockId=radio_datagram_send_value block=\"radio send|value %name|= %value\" blockGap=8 shim=radio::sendValue\n function sendValue(name: string, value: number): void;\n\n /**\n * Broadcasts a string along with the device serial number\n * and running time to any connected micro:bit in the group.\n */\n //% help=radio/send-string\n //% weight=58\n //% blockId=radio_datagram_send_string block=\"radio send string %msg\" shim=radio::sendString\n function sendString(msg: string): void;\n\n /**\n * Reads the next packet from the radio queue and and writes it to serial\n * as JSON.\n */\n //% help=radio/write-value-to-serial\n //% weight=3\n //% blockId=radio_write_value_serial block=\"radio write value to serial\"\n //% deprecated=true shim=radio::writeValueToSerial\n function writeValueToSerial(): void;\n\n /**\n * Writes the last received packet to serial as JSON. This should be called\n * within an ``onDataPacketReceived`` callback.\n */\n //% help=radio/write-received-packet-to-serial\n //% weight=3\n //% blockId=radio_write_packet_serial block=\"radio write received packet to serial\"\n //% advanced=true shim=radio::writeReceivedPacketToSerial\n function writeReceivedPacketToSerial(): void;\n\n /**\n * Reads the next packet from the radio queue and returns the packet's number\n * payload or 0 if the packet did not contain a number.\n */\n //% help=radio/receive-number\n //% weight=46\n //% blockId=radio_datagram_receive block=\"radio receive number\" blockGap=8\n //% deprecated=true shim=radio::receiveNumber\n function receiveNumber(): number;\n\n /**\n * Registers code to run when a packet is received over radio.\n */\n //% help=radio/on-data-received\n //% weight=50\n //% blockId=radio_datagram_received_event block=\"radio on data received\" blockGap=8\n //% deprecated=true shim=radio::onDataReceived\n function onDataReceived(body: () => void): void;\n\n /**\n * Reads the next packet from the radio queue and returns the packet's string\n * payload or the empty string if the packet did not contain a string.\n */\n //% blockId=radio_datagram_receive_string block=\"radio receive string\" blockGap=8\n //% weight=44\n //% help=radio/receive-string\n //% deprecated=true shim=radio::receiveString\n function receiveString(): string;\n\n /**\n * Gets the received signal strength indicator (RSSI) from the last packet taken\n * from the radio queue (via ``receiveNumber``, ``receiveString``, etc). Not supported in simulator.\n * namespace=radio\n */\n //% help=radio/received-signal-strength\n //% weight=40\n //% blockId=radio_datagram_rssi block=\"radio received signal strength\"\n //% deprecated=true shim=radio::receivedSignalStrength\n function receivedSignalStrength(): number;\n\n /**\n * Sets the group id for radio communications. A micro:bit can only listen to one group ID at any time.\n * @ param id the group id between ``0`` and ``255``, 1 eg\n */\n //% help=radio/set-group\n //% weight=10 blockGap=8 advanced=true\n //% blockId=radio_set_group block=\"radio set group %ID\" shim=radio::setGroup\n function setGroup(id: number): void;\n\n /**\n * Change t
},
"devices": {
"README.md": "# devices\n",
"devices.cpp": "#include \"pxt.h\"\n#include \"MESEvents.h\"\n\nusing namespace pxt;\n\nenum class MesCameraEvent {\n //% block=\"take photo\"\n TakePhoto = MES_CAMERA_EVT_TAKE_PHOTO,\n //% block=\"start video capture\"\n StartVideoCapture = MES_CAMERA_EVT_START_VIDEO_CAPTURE,\n //% block=\"stop video capture\"\n StopVideoCapture = MES_CAMERA_EVT_STOP_VIDEO_CAPTURE,\n //% block=\"toggle front-rear\"\n ToggleFrontRear = MES_CAMERA_EVT_TOGGLE_FRONT_REAR,\n //% block=\"launch photo mode\"\n LaunchPhotoMode = MES_CAMERA_EVT_LAUNCH_PHOTO_MODE,\n //% block=\"launch video mode\"\n LaunchVideoMode = MES_CAMERA_EVT_LAUNCH_VIDEO_MODE,\n //% block=\"stop photo mode\"\n StopPhotoMode = MES_CAMERA_EVT_STOP_PHOTO_MODE,\n //% block=\"stop video mode\"\n StopVideoMode = MES_CAMERA_EVT_STOP_VIDEO_MODE,\n};\n\nenum class MesAlertEvent {\n //% block=\"display toast\"\n DisplayToast = MES_ALERT_EVT_DISPLAY_TOAST,\n //% block=\"vibrate\"\n Vibrate = MES_ALERT_EVT_VIBRATE,\n //% block=\"play sound\"\n PlaySound = MES_ALERT_EVT_PLAY_SOUND,\n //% block=\"play ring tone\"\n PlayRingtone = MES_ALERT_EVT_PLAY_RINGTONE,\n //% block=\"find my phone\"\n FindMyPhone = MES_ALERT_EVT_FIND_MY_PHONE,\n //% block=\"ring alarm\"\n RingAlarm = MES_ALERT_EVT_ALARM1,\n //% block=\"ring alarm 2\"\n RingAlarm2 = MES_ALERT_EVT_ALARM2,\n //% block=\"ring alarm 3\"\n RingAlarm3 = MES_ALERT_EVT_ALARM3,\n //% block=\"ring alarm 4\"\n RingAlarm4 = MES_ALERT_EVT_ALARM4,\n //% block=\"ring alarm 5\"\n RingAlarm5 = MES_ALERT_EVT_ALARM5,\n //% block=\"ring alarm 6\"\n RingAlarm6 = MES_ALERT_EVT_ALARM6,\n};\n\nenum class MesDeviceInfo {\n //% block=\"incoming call\"\n IncomingCall = MES_DEVICE_INCOMING_CALL,\n //% block=\"incoming message\"\n IncomingMessage = MES_DEVICE_INCOMING_MESSAGE,\n //% block=\"orientation landscape\"\n OrientationLandscape = MES_DEVICE_ORIENTATION_LANDSCAPE,\n //% block=\"orientation portrait\"\n OrientationPortrait = MES_DEVICE_ORIENTATION_PORTRAIT,\n //% block=\"shaken\"\n Shaken = MES_DEVICE_GESTURE_DEVICE_SHAKEN,\n //% block=\"display off\"\n DisplayOff = MES_DEVICE_DISPLAY_OFF,\n //% block=\"display on\"\n DisplayOn = MES_DEVICE_DISPLAY_ON,\n};\n\nenum class MesRemoteControlEvent {\n //% block=\"play\"\n play = MES_REMOTE_CONTROL_EVT_PLAY,\n //% block=\"pause\"\n pause = MES_REMOTE_CONTROL_EVT_PAUSE,\n //% block=\"stop\"\n stop = MES_REMOTE_CONTROL_EVT_STOP,\n //% block=\"next track\"\n nextTrack = MES_REMOTE_CONTROL_EVT_NEXTTRACK,\n //% block=\"previous track\"\n previousTrack = MES_REMOTE_CONTROL_EVT_PREVTRACK,\n //% block=\"forward\"\n forward = MES_REMOTE_CONTROL_EVT_FORWARD,\n //% block=\"rewind\"\n rewind = MES_REMOTE_CONTROL_EVT_REWIND,\n //% block=\"volume up\"\n volumeUp = MES_REMOTE_CONTROL_EVT_VOLUMEUP,\n //% block=\"volume down\"\n volumeDown = MES_REMOTE_CONTROL_EVT_VOLUMEDOWN,\n};\n\nenum class MesDpadButtonInfo {\n //% block=\"A down\"\n ADown = MES_DPAD_BUTTON_A_DOWN,\n //% block=\"A up\"\n AUp = MES_DPAD_BUTTON_A_UP,\n //% block=\"B down\"\n BDown = MES_DPAD_BUTTON_B_DOWN,\n //% block=\"B up\"\n BUp = MES_DPAD_BUTTON_B_UP,\n //% block=\"C down\"\n CDown = MES_DPAD_BUTTON_C_DOWN,\n //% block=\"C up\"\n CUp = MES_DPAD_BUTTON_C_UP,\n //% block=\"D down\"\n DDown = MES_DPAD_BUTTON_D_DOWN,\n //% block=\"D up\"\n DUp = MES_DPAD_BUTTON_D_UP,\n //% block=\"1 down\"\n _1Down = MES_DPAD_BUTTON_1_UP,\n //% block=\"1 up\"\n _1Up = MES_DPAD_BUTTON_1_DOWN,\n //% block=\"2 down\"\n _2Down = MES_DPAD_BUTTON_2_DOWN,\n //% block=\"2 up\"\n _2Up = MES_DPAD_BUTTON_2_UP,\n //% block=\"3 down\"\n _3Down = MES_DPAD_BUTTON_3_DOWN,\n //% block=\"3 up\"\n _3Up = MES_DPAD_BUTTON_3_UP,\n //% block=\"4 down\"\n _4Down = MES_DPAD_BUTTON_4_DOWN,\n //% block=\"4 up\"\n _4Up = MES_DPAD_BUTTON_4_UP,\n};\n\n/**\n * Control a phone with the BBC micro:bit
"enums.d.ts": "// Auto-generated. Do not edit.\n\n\n declare enum MesCameraEvent {\n //% block=\"take photo\"\n TakePhoto = 3, // MES_CAMERA_EVT_TAKE_PHOTO\n //% block=\"start video capture\"\n StartVideoCapture = 4, // MES_CAMERA_EVT_START_VIDEO_CAPTURE\n //% block=\"stop video capture\"\n StopVideoCapture = 5, // MES_CAMERA_EVT_STOP_VIDEO_CAPTURE\n //% block=\"toggle front-rear\"\n ToggleFrontRear = 8, // MES_CAMERA_EVT_TOGGLE_FRONT_REAR\n //% block=\"launch photo mode\"\n LaunchPhotoMode = 1, // MES_CAMERA_EVT_LAUNCH_PHOTO_MODE\n //% block=\"launch video mode\"\n LaunchVideoMode = 2, // MES_CAMERA_EVT_LAUNCH_VIDEO_MODE\n //% block=\"stop photo mode\"\n StopPhotoMode = 6, // MES_CAMERA_EVT_STOP_PHOTO_MODE\n //% block=\"stop video mode\"\n StopVideoMode = 7, // MES_CAMERA_EVT_STOP_VIDEO_MODE\n }\n\n\n declare enum MesAlertEvent {\n //% block=\"display toast\"\n DisplayToast = 1, // MES_ALERT_EVT_DISPLAY_TOAST\n //% block=\"vibrate\"\n Vibrate = 2, // MES_ALERT_EVT_VIBRATE\n //% block=\"play sound\"\n PlaySound = 3, // MES_ALERT_EVT_PLAY_SOUND\n //% block=\"play ring tone\"\n PlayRingtone = 4, // MES_ALERT_EVT_PLAY_RINGTONE\n //% block=\"find my phone\"\n FindMyPhone = 5, // MES_ALERT_EVT_FIND_MY_PHONE\n //% block=\"ring alarm\"\n RingAlarm = 6, // MES_ALERT_EVT_ALARM1\n //% block=\"ring alarm 2\"\n RingAlarm2 = 7, // MES_ALERT_EVT_ALARM2\n //% block=\"ring alarm 3\"\n RingAlarm3 = 8, // MES_ALERT_EVT_ALARM3\n //% block=\"ring alarm 4\"\n RingAlarm4 = 9, // MES_ALERT_EVT_ALARM4\n //% block=\"ring alarm 5\"\n RingAlarm5 = 10, // MES_ALERT_EVT_ALARM5\n //% block=\"ring alarm 6\"\n RingAlarm6 = 11, // MES_ALERT_EVT_ALARM6\n }\n\n\n declare enum MesDeviceInfo {\n //% block=\"incoming call\"\n IncomingCall = 7, // MES_DEVICE_INCOMING_CALL\n //% block=\"incoming message\"\n IncomingMessage = 8, // MES_DEVICE_INCOMING_MESSAGE\n //% block=\"orientation landscape\"\n OrientationLandscape = 1, // MES_DEVICE_ORIENTATION_LANDSCAPE\n //% block=\"orientation portrait\"\n OrientationPortrait = 2, // MES_DEVICE_ORIENTATION_PORTRAIT\n //% block=\"shaken\"\n Shaken = 4, // MES_DEVICE_GESTURE_DEVICE_SHAKEN\n //% block=\"display off\"\n DisplayOff = 5, // MES_DEVICE_DISPLAY_OFF\n //% block=\"display on\"\n DisplayOn = 6, // MES_DEVICE_DISPLAY_ON\n }\n\n\n declare enum MesRemoteControlEvent {\n //% block=\"play\"\n play = 1, // MES_REMOTE_CONTROL_EVT_PLAY\n //% block=\"pause\"\n pause = 2, // MES_REMOTE_CONTROL_EVT_PAUSE\n //% block=\"stop\"\n stop = 3, // MES_REMOTE_CONTROL_EVT_STOP\n //% block=\"next track\"\n nextTrack = 4, // MES_REMOTE_CONTROL_EVT_NEXTTRACK\n //% block=\"previous track\"\n previousTrack = 5, // MES_REMOTE_CONTROL_EVT_PREVTRACK\n //% block=\"forward\"\n forward = 6, // MES_REMOTE_CONTROL_EVT_FORWARD\n //% block=\"rewind\"\n rewind = 7, // MES_REMOTE_CONTROL_EVT_REWIND\n //% block=\"volume up\"\n volumeUp = 8, // MES_REMOTE_CONTROL_EVT_VOLUMEUP\n //% block=\"volume down\"\n volumeDown = 9, // MES_REMOTE_CONTROL_EVT_VOLUMEDOWN\n }\n\n\n declare enum MesDpadButtonInfo {\n //% block=\"A down\"\n ADown = 1, // MES_DPAD_BUTTON_A_DOWN\n //% block=\"A up\"\n AUp = 2, // MES_DPAD_BUTTON_A_UP\n //% block=\"B down\"\n BDown = 3, // MES_DPAD_BUTTON_B_DOWN\n //% block=\"B up\"\n BUp = 4, // MES_DPAD_BUTTON_B_UP\n //% block=\"C down\"\n CDown = 5, // MES_DPAD_BUTTON_C_DOWN\n //% block=\"C up\"\n CUp = 6, // MES_DPAD_BUTTON_C_UP\n //% block=\"D down\"\n DDown = 7, // MES_DPAD_BUTTON_D_DOWN\n //% block=\"D up\"\n DUp = 8, // MES_DPAD_BUTTON_D_UP\n //% block=\"1 down\"\n _1Down = 10, // MES_DPAD_BUTTON_1_UP\n //% block=\"1 up\"\n _1Up = 9, // MES_DPAD_BUTTON_1_DOWN\n //% block=\"2 down\"\n _2Down = 11, // MES_DPAD_BUTTON_2_DOWN\n //% block=\"2 up\"\n _2Up = 12, // MES_DPAD_BUTTON_2
"pxt.json": "{\n \"name\": \"devices\",\n \"description\": \"The BLE specific services\",\n \"files\": [\n \"README.md\",\n \"enums.d.ts\",\n \"shims.d.ts\",\n \"devices.cpp\"\n ],\n \"public\": true,\n \"dependencies\": {\n \"core\": \"*\"\n },\n \"yotta\": {\n \"config\": {\n \"microbit-dal\": {\n \"bluetooth\": {\n \"enabled\": 1\n }\n }\n }\n }\n}",
"shims.d.ts": "// Auto-generated. Do not edit.\n\n\n /**\n * Control a phone with the BBC micro:bit via Bluetooth.\n */\n //% color=156 weight=80\ndeclare namespace devices {\n\n /**\n * Sends a ``camera`` command to the parent device.\n * @param event event description\n */\n //% weight=30 help=devices/tell-camera-to\n //% blockId=devices_camera icon=\"\\uf030\" block=\"tell camera to|%property\" blockGap=8 shim=devices::tellCameraTo\n function tellCameraTo(event: MesCameraEvent): void;\n\n /**\n * Sends a ``remote control`` command to the parent device.\n * @param event event description\n */\n //% weight=29 help=devices/tell-remote-control-to\n //% blockId=devices_remote_control block=\"tell remote control to|%property\" blockGap=14 icon=\"\\uf144\" shim=devices::tellRemoteControlTo\n function tellRemoteControlTo(event: MesRemoteControlEvent): void;\n\n /**\n * Sends an ``alert`` command to the parent device.\n * @param event event description\n */\n //% weight=27 help=devices/raise-alert-to\n //% blockId=devices_alert block=\"raise alert to|%property\" icon=\"\\uf0f3\" shim=devices::raiseAlertTo\n function raiseAlertTo(event: MesAlertEvent): void;\n\n /**\n * Registers code to run when the device notifies about a particular event.\n * @param event event description\n * @param body code handler when event is triggered\n */\n //% help=devices/on-notified weight=26\n //% blockId=devices_device_info_event block=\"on notified|%event\" icon=\"\\uf10a\" shim=devices::onNotified\n function onNotified(event: MesDeviceInfo, body: () => void): void;\n\n /**\n * Register code to run when the micro:bit receives a command from the paired gamepad.\n * @param name button name\n * @param body code to run when button is pressed\n */\n //% help=devices/on-gamepad-button weight=40\n //% weight=25\n //% blockId=devices_gamepad_event block=\"on gamepad button|%NAME\" icon=\"\\uf11b\" shim=devices::onGamepadButton\n function onGamepadButton(name: MesDpadButtonInfo, body: () => void): void;\n\n /**\n * Returns the last signal strength reported by the paired device.\n */\n //% help=devices/signal-strength weight=24\n //% blockId=devices_signal_strength block=\"signal strength\" blockGap=14 icon=\"\\uf012\" blockGap=14 shim=devices::signalStrength\n function signalStrength(): number;\n\n /**\n * Registers code to run when the device notifies about a change of signal strength.\n * @param body Code run when the signal strength changes.\n */\n //% weight=23 help=devices/on-signal-strength-changed\n //% blockId=devices_signal_strength_changed_event block=\"on signal strength changed\" icon=\"\\uf012\" shim=devices::onSignalStrengthChanged\n function onSignalStrengthChanged(body: () => void): void;\n}\n\n// Auto-generated. Do not edit. Really.\n"
},
"bluetooth": {
"README.md": "# Bluetooth services\n",
"_locales/de/bluetooth-jsdoc-strings.json": "{\n \"bluetooth\": \"Unterstützung für zusätzliche Bluetooth-Dienste.\",\n \"bluetooth.onBluetoothConnected|param|body\": \"Code, der ausgeführt wird, wenn eine Bluetooth-Verbindung aufgebaut wurde\",\n \"bluetooth.uartWriteNumber\": \"Gibt einen numerischen Wert an die serielle\",\n \"bluetooth.uartWriteValue\": \"Schreibt ein ``Namen: Wert`` Wertepaar auf die serielle Schnittstelle.\",\n \"bluetooth.uartWriteValue|param|name\": \"Name des Wertestreams, z.B.: x\",\n \"bluetooth.uartWriteValue|param|value\": \"Schreiben\"\n}",
"bluetooth.cpp": "#include \"pxt.h\"\n#include \"MESEvents.h\"\n#include \"MicroBitUARTService.h\"\n\nusing namespace pxt;\n\n/**\n * Support for additional Bluetooth services.\n */\n//% color=#0082FB weight=20\nnamespace bluetooth {\n MicroBitUARTService *uart = NULL;\n\n\n /**\n * Starts the Bluetooth accelerometer service\n */\n //% help=bluetooth/start-accelerometer-service\n //% blockId=bluetooth_start_accelerometer_service block=\"bluetooth accelerometer service\"\n //% parts=\"bluetooth\" weight=90 blockGap=8\n void startAccelerometerService() {\n new MicroBitAccelerometerService(*uBit.ble, uBit.accelerometer); \n } \n\n /**\n * Starts the Bluetooth button service\n */\n //% help=bluetooth/start-button-service\n //% blockId=bluetooth_start_button_service block=\"bluetooth button service\" blockGap=8\n //% parts=\"bluetooth\" weight=89\n void startButtonService() {\n new MicroBitButtonService(*uBit.ble); \n }\n\n /**\n * Starts the Bluetooth IO pin service.\n */\n //% help=bluetooth/start-io-pin-service\n //% blockId=bluetooth_start_io_pin_service block=\"bluetooth io pin service\" blockGap=8\n //% parts=\"bluetooth\" weight=88\n void startIOPinService() {\n new MicroBitIOPinService(*uBit.ble, uBit.io);\n }\n\n /**\n * Starts the Bluetooth LED service\n */\n //% help=bluetooth/start-led-service\n //% blockId=bluetooth_start_led_service block=\"bluetooth led service\" blockGap=8\n //% parts=\"bluetooth\" weight=87\n void startLEDService() {\n new MicroBitLEDService(*uBit.ble, uBit.display);\n }\n\n /**\n * Starts the Bluetooth temperature service\n */\n //% help=bluetooth/start-temperature-service\n //% blockId=bluetooth_start_temperature_service block=\"bluetooth temperature service\" blockGap=8\n //% parts=\"bluetooth\" weight=86\n void startTemperatureService() { \n new MicroBitTemperatureService(*uBit.ble, uBit.thermometer); \n }\n\n /**\n * Starts the Bluetooth magnetometer service\n */\n //% help=bluetooth/start-magnetometer-service\n //% blockId=bluetooth_start_magnetometer_service block=\"bluetooth magnetometer service\"\n //% parts=\"bluetooth\" weight=85\n void startMagnetometerService() { \n new MicroBitMagnetometerService(*uBit.ble, uBit.compass); \n }\n\n\n /**\n * Starts the Bluetooth UART service\n */\n //% help=bluetooth/start-uart-service\n //% blockId=bluetooth_start_uart_service block=\"bluetooth uart service\"\n //% parts=\"bluetooth\" advanced=true\n void startUartService() {\n if (uart) return;\n // 61 octet buffer size is 3 x (MTU - 3) + 1\n // MTU on nRF51822 is 23 octets. 3 are used by Attribute Protocol header data leaving 20 octets for payload\n // So we allow a RX buffer that can contain 3 x max length messages plus one octet for a terminator character\n uart = new MicroBitUARTService(*uBit.ble, 61, 60);\n }\n \n //%\n void uartWriteString(StringData *data) {\n startUartService();\n \tuart->send(ManagedString(data));\n } \n\n //%\n StringData* uartReadUntil(StringData *del) {\n startUartService();\n return uart->readUntil(ManagedString(del)).leakData();\n } \n\n /**\n * Register code to run when the micro:bit is connected to over Bluetooth\n * @param body Code to run when a Bluetooth connection is established\n */\n //% help=bluetooth/on-bluetooth-connected weight=20\n //% blockId=bluetooth_on_connected block=\"on bluetooth connected\" blockGap=8\n //% parts=\"bluetooth\"\n void onBluetoothConnected(Action body) {\n registerWithDal(MICROBIT_ID_BLE, MICROBIT_BLE_EVT_CONNECTED, body);\n } \n\n /**\n * Register code to run when a bluetooth connection to the micro:bit is lost\n * @param body Code to run when a Bluetooth connection is lost\n */\n //% help=bluetooth/on-bluetooth-disconnected weight=19\n
"bluetooth.ts": "/**\n * Support for additional Bluetooth services.\n */\n//% color=#0082FB weight=20 icon=\"\\uf294\"\nnamespace bluetooth {\n /**\n * Writes to the Bluetooth UART service buffer. From there the data is transmitted over Bluetooth to a connected device.\n */\n //% help=bluetooth/uart-write-string weight=80\n //% blockId=bluetooth_uart_write block=\"bluetooth uart|write string %data\" blockGap=8\n //% parts=\"bluetooth\" shim=bluetooth::uartWriteString advanced=true\n export function uartWriteString(data: string): void {\n // dummy implementation for simulator\n console.log(\"UART Write: \" + data)\n }\n\n /**\n * Prints a numeric value to the serial\n */\n //% help=bluetooth/uart-write-number weight=79\n //% weight=89 blockGap=8 advanced=true\n //% blockId=bluetooth_uart_writenumber block=\"bluetooth uart|write number %value\"\n export function uartWriteNumber(value: number): void {\n uartWriteString(value.toString());\n }\n\n /**\n * Writes a ``name: value`` pair line to the serial.\n * @param name name of the value stream, eg: x\n * @param value to write\n */\n //% weight=88 weight=78\n //% help=bluetooth/uart-write-value advanced=true\n //% blockId=bluetooth_uart_writevalue block=\"bluetooth uart|write value %name|= %value\"\n export function uartWriteValue(name: string, value: number): void {\n uartWriteString(name + \":\" + value + \"\\r\\n\");\n }\n\n /**\n * Reads from the Bluetooth UART service buffer, returning its contents when the specified delimiter character is encountered.\n */\n //% help=bluetooth/uart-read-until weight=75\n //% blockId=bluetooth_uart_read block=\"bluetooth uart|read until %del=serial_delimiter_conv\"\n //% parts=\"bluetooth\" shim=bluetooth::uartReadUntil advanced=true\n export function uartReadUntil(del: string): string {\n // dummy implementation for simulator\n return \"???\"\n }\n}\n",
"enums.d.ts": "// Auto-generated. Do not edit.\ndeclare namespace bluetooth {\n}\n\n// Auto-generated. Do not edit. Really.\n",
"pxt.json": "{\n \"name\": \"bluetooth\",\n \"description\": \"Bluetooth services\",\n \"files\": [\n \"README.md\",\n \"enums.d.ts\",\n \"shims.d.ts\",\n \"bluetooth.ts\",\n \"bluetooth.cpp\",\n \"_locales/de/bluetooth-jsdoc-strings.json\"\n ],\n \"public\": true,\n \"dependencies\": {\n \"core\": \"*\"\n },\n \"yotta\": {\n \"config\": {\n \"microbit-dal\": {\n \"bluetooth\": {\n \"enabled\": 1,\n \"pairing_mode\": 1,\n \"private_addressing\": 0,\n \"open\": 0,\n \"whitelist\": 1,\n \"advertising_timeout\": 0,\n \"tx_power\": 6,\n \"dfu_service\": 1,\n \"event_service\": 1,\n \"device_info_service\": 1\n },\n \"gatt_table_size\": \"0x700\"\n }\n }\n }\n}",
"shims.d.ts": "// Auto-generated. Do not edit.\n\n\n /**\n * Support for additional Bluetooth services.\n */\n //% color=#0082FB weight=20\ndeclare namespace bluetooth {\n\n /**\n * Starts the Bluetooth accelerometer service\n */\n //% help=bluetooth/start-accelerometer-service\n //% blockId=bluetooth_start_accelerometer_service block=\"bluetooth accelerometer service\"\n //% parts=\"bluetooth\" weight=90 blockGap=8 shim=bluetooth::startAccelerometerService\n function startAccelerometerService(): void;\n\n /**\n * Starts the Bluetooth button service\n */\n //% help=bluetooth/start-button-service\n //% blockId=bluetooth_start_button_service block=\"bluetooth button service\" blockGap=8\n //% parts=\"bluetooth\" weight=89 shim=bluetooth::startButtonService\n function startButtonService(): void;\n\n /**\n * Starts the Bluetooth IO pin service.\n */\n //% help=bluetooth/start-io-pin-service\n //% blockId=bluetooth_start_io_pin_service block=\"bluetooth io pin service\" blockGap=8\n //% parts=\"bluetooth\" weight=88 shim=bluetooth::startIOPinService\n function startIOPinService(): void;\n\n /**\n * Starts the Bluetooth LED service\n */\n //% help=bluetooth/start-led-service\n //% blockId=bluetooth_start_led_service block=\"bluetooth led service\" blockGap=8\n //% parts=\"bluetooth\" weight=87 shim=bluetooth::startLEDService\n function startLEDService(): void;\n\n /**\n * Starts the Bluetooth temperature service\n */\n //% help=bluetooth/start-temperature-service\n //% blockId=bluetooth_start_temperature_service block=\"bluetooth temperature service\" blockGap=8\n //% parts=\"bluetooth\" weight=86 shim=bluetooth::startTemperatureService\n function startTemperatureService(): void;\n\n /**\n * Starts the Bluetooth magnetometer service\n */\n //% help=bluetooth/start-magnetometer-service\n //% blockId=bluetooth_start_magnetometer_service block=\"bluetooth magnetometer service\"\n //% parts=\"bluetooth\" weight=85 shim=bluetooth::startMagnetometerService\n function startMagnetometerService(): void;\n\n /**\n * Starts the Bluetooth UART service\n */\n //% help=bluetooth/start-uart-service\n //% blockId=bluetooth_start_uart_service block=\"bluetooth uart service\"\n //% parts=\"bluetooth\" advanced=true shim=bluetooth::startUartService\n function startUartService(): void;\n\n /**\n * Register code to run when the micro:bit is connected to over Bluetooth\n * @param body Code to run when a Bluetooth connection is established\n */\n //% help=bluetooth/on-bluetooth-connected weight=20\n //% blockId=bluetooth_on_connected block=\"on bluetooth connected\" blockGap=8\n //% parts=\"bluetooth\" shim=bluetooth::onBluetoothConnected\n function onBluetoothConnected(body: () => void): void;\n\n /**\n * Register code to run when a bluetooth connection to the micro:bit is lost\n * @param body Code to run when a Bluetooth connection is lost\n */\n //% help=bluetooth/on-bluetooth-disconnected weight=19\n //% blockId=bluetooth_on_disconnected block=\"on bluetooth disconnected\"\n //% parts=\"bluetooth\" shim=bluetooth::onBluetoothDisconnected\n function onBluetoothDisconnected(body: () => void): void;\n}\n\n// Auto-generated. Do not edit. Really.\n"
},
"pxt-calliope-bc95": {
"README.md": "# Calliope mini BC95 NB-IoT module\n\nThis is a package for controlling an NB-IoT module to send messages from the Calliope mini.\nIt can be used by the [PXT Calliope mini editor](https://pxt.calliope.cc/). Should also work\nwith PXT for Micro:bit.\n\nMore information on the module can be found on the [Quectel website](http://www.quectel.com/product/bc95.htm).\nIt is used in conjunction with an [evaluation kit](http://www.quectel.com/product/gsmevb.htm).\n\nThe code may be used as a starting point for similar AT based systems.\n\n## Testing\n\n- Modify `tests.ts` to send packages to your own server.\n- Execute a little server: `nc -vv -ul -p 5883` (Linux, also echos the messages) \n- Compile the test `pxt test` and copy `built/binary.hex` to the Calliope mini.\n\nOn the USB console window you will see this:\n\n```\nSTART TEST\nTEST: modem working: OK\nTEST: enable all functionality: OK\nTEST: check IMSI: OK\nTEST: connect to network: OK\nTEST: check signal quality: OK\nTEST: check network stats: OK\nTEST: check PDP context: OK\nTEST: check address: OK\nTEST: check band: OK\nTEST: ping external server: OK\nTEST: expect ping reply: OK\nTEST: sending number: OK\nTEST: sending string: OK\nTEST FINISHED OK\n``` \n\n> You can follow the AT flow on the USB serial console by enabling debug in `tests.ts`\n\nThe server should show something like this:\n\n```\nconnect to [46.23.86.61] from tmo-121-137.customers.d1-online.com [80.187.121.137] 25519\n {\"id\":\"bc9ab239\",\"p\":{\"test\":123}}{\"id\":\"bc9ab239\",\"p\":{\"test\":\"value 123\"}}\n```\n\n## Example\n\n### Blocks\n![Example Code](example.png)\n\n### Javascript\n\n```typescript\ninput.onButtonPressed(Button.A, () => {\n bc95.sendString(\n \"Hallo\",\n \"Calliope mini\"\n )\n if (bc95.sendOk()) {\n basic.showIcon(IconNames.Yes)\n } else {\n basic.showIcon(IconNames.No)\n }\n basic.pause(1000)\n basic.clearScreen()\n})\ninput.onButtonPressed(Button.B, () => {\n bc95.sendNumber(\n \"t\",\n input.temperature()\n )\n if (bc95.sendOk()) {\n basic.showIcon(IconNames.Yes)\n } else {\n basic.showIcon(IconNames.No)\n }\n basic.pause(1000)\n basic.clearScreen()\n})\nbc95.init(\n SerialPin.C17,\n SerialPin.C16,\n BaudRate.BaudRate9600\n)\nbc95.attach()\nbc95.setServer(\"46.23.86.61\", 5883)\n```\n\n```\n$ listening on [any] 5883 ...\n connect to [46.23.86.61] from tmo-121-137.customers.d1-online.com [80.187.121.137] 24189\n {\"id\":\"bc9ab239\",\"p\":{\"t\":29}}{\"id\":\"bc9ab239\",\"p\":{\"Hallo\":\"Calliope mini\"}}\n\n```\n\n## TODO\n\n- extract AT response parsing into its own module, to make it usable for other devices\n- handle incoming messages\n\n## Meta\n\n- PXT/calliope\n- PXT/microbit\n\nAuthor: Matthias L. Jugel ([@thinkberg](https://twitter.com/thinkberg))\n\n## License\n\nMIT",
"_locales/de/pxt-calliope-bc95-jsdoc-strings.json": "{\n \"bc95\": \"Funktionen für das NB-IoT Modul BC95\",\n \"bc95.attach\": \"Verbinde NB-IoT Netzwerk.\",\n \"bc95.enableDebug\": \"Starte AT-Kommando Debugausgabe.\",\n \"bc95.expectAT\": \"Sende ein AT Kommando an das Modul. Nur den Befehl, ohne den AT Prefix, z.B. AT(\\\"+CIMI\\\"). Gibt die erste Zeile der Antwort des Modules zurück.\",\n \"bc95.expectAT|param|command\": \"AT Kommando ohne Prefix\",\n \"bc95.expectOK\": \"Sende ein AT Kommando an das Modul und erwarte OK. Nur den Befehl ohne AT Prefix, z.B. AT(\\\"+CGMI=?\\\"). Gibt Erfolg zurück.\",\n \"bc95.expectOK|param|command\": \"AT Kommando ohne Prefix\",\n \"bc95.init\": \"Intialisiere das BC95 Modul mit dem Seriellen Port.\",\n \"bc95.init|param|rate\": \"die Baud Rate, z.B. BaudRate.BaudRate9600\",\n \"bc95.init|param|rx\": \"der Empfangs-Pin, z.B. SerialPin.C16\",\n \"bc95.init|param|tx\": \"der Sende-Pin, z.B. SerialPin.C17\",\n \"bc95.pushAT\": \"Sende eine AT Kommando an das Modul. Nur den Befehl, ohne den AT Prefix, z.B. AT(\\\"+CIMI\\\"). Ignoriert das Ergebnis.\",\n \"bc95.pushAT|param|command\": \"AT Kommando ohne Prefix\",\n \"bc95.sendNumber\": \"Sende eine Nummer zum Server.\",\n \"bc95.sendOk\": \"Prüft, ob die letzte Sendeoperation erfolgreich war.\\nSetzt den Status zurück.\",\n \"bc95.sendString\": \"Sende Text zum Server.\",\n \"bc95.setAPN\": \"Konfiguriert den APN Zugangspunkt inkl. Nutzernamen und Passwort.\",\n \"bc95.setAPN|param|apn\": \"Zugangspunkt, z.B. internet.nbiot.telekom.de\",\n \"bc95.setAPN|param|password\": \"Passwort\",\n \"bc95.setAPN|param|user\": \"Benutzername\",\n \"bc95.setServer\": \"Konfiguriert die IP Adresse des UDP Empfangsservers.\",\n \"bc95.setServer|param|host\": \"IP Adresse des Empfangsservers\",\n \"bc95.setServer|param|port\": \"Portadresse des Empfangsservers, z.B. 5883\",\n \"serial\": \"Reading and writing data over a serial connection.\",\n \"serial.resetSerial\": \"Setze seriellen Port zurück auf USBTX/USBRX.\",\n \"serial.setReceiveBufferSize\": \"Setze Empfangspuffergröße.\"\n}",
"_locales/de/pxt-calliope-bc95-strings.json": "{\n \"bc95.attach|block\": \"verbinde mit NB-IoT Netzwerk\",\n \"bc95.enableDebug|block\": \"debugge AT %debug\",\n \"bc95.expectAT|block\": \"sende AT %command und empfange\",\n \"bc95.expectOK|block\": \"prüfe AT %command|Resultat OK?\",\n \"bc95.init|block\": \"initialisiere BC95|TX %tx|RX %rx|mit Baudrate %rate\",\n \"bc95.pushAT|block\": \"sende AT %command\",\n \"bc95.sendNumber|block\": \"sende Zahlennachricht|Name %key|Wert %n\",\n \"bc95.sendOk|block\": \"senden erfolgreich?\",\n \"bc95.sendString|block\": \"sende Textnachricht|Name %key|Wert %n\",\n \"bc95.setAPN|block\": \"setze APN %apn|Benutzer %user|Passwort %password\",\n \"bc95.setServer|block\": \"setze Server Adresse %host|Port %port\",\n \"bc95|block\": \"BC95\",\n \"serial.resetSerial|block\": \"seriellen Port zurücksetzen\",\n \"serial.setReceiveBufferSize|block\": \"setze Empfangspuffergrösse %size\",\n \"serial|block\": \"seriell\",\n \"{id:category}Bc95\": \"BC95\",\n \"{id:category}Serial\": \"Seriell\"\n}",
"bc95.cpp": "#include \"pxt.h\"\n\nnamespace bc95 {\n //%\n StringData *getSerialNumber() {\n char tmp[9];\n snprintf(tmp, 9, \"%8lx\", microbit_serial_number());\n return ManagedString(tmp).leakData();\n }\n}\n\nnamespace serial {\n //%\n void setReceiveBufferSize(int size) {\n uBit.serial.setRxBufferSize(size);\n }\n\n //%\n void resetSerial() {\n uBit.serial.redirect(USBTX, USBRX);\n uBit.serial.baud(MICROBIT_SERIAL_DEFAULT_BAUD_RATE);\n }\n\n //%\n StringData *readLine_() {\n return uBit.serial.readUntil(ManagedString(\"\\n\")).leakData();\n }\n\n}\n",
"bc95.ts": "/**\n * Functions for the NB-IoT module bc95\n */\n\n//% weight=2 color=#A8BCBC icon=\"\\uf1d9\"\n//% parts=\"bc95 \nnamespace bc95 {\n // enabling DEBUG allows to follow the AT flow on the USB serial port\n // this switches the serial back and forth and introduces delays\n let DEBUG = false;\n\n let TX = SerialPin.C17;\n let RX = SerialPin.C16;\n let BAUD = BaudRate.BaudRate9600;\n\n let SERVER = \"\";\n let PORT = 44567;\n let APN = \"internet.nbiot.telekom.de\";\n let USER = \"\";\n let PASS = \"\";\n let ERROR = false;\n\n /**\n * Initialize bc95 module serial port.\n * @param tx the new transmission pins, eg: SerialPin.C17\n * @param rx the new reception pin, eg: SerialPin.C16\n * @param rate the new baud rate, eg: BaudRate.BaudRate9600\n */\n //% weight=210\n //% blockId=bc95_init block=\"initialize BC95|TX %tx|RX %rx|at baud rate %rate\"\n //% blockExternalInputs=1\n //% parts=\"bc95\"\n export function init(tx: SerialPin, rx: SerialPin, rate: BaudRate): void {\n TX = tx;\n RX = rx;\n BAUD = rate;\n serial.redirect(TX, RX, BAUD);\n serial.setReceiveBufferSize(100);\n }\n\n /**\n * Attach to the mobile network. May take up to 30s.\n */\n //% weight=209\n //% blockId=bc95_attach block=\"attach NB-IoT network\"\n //% parts=\"bc95\"\n export function attach(): void {\n expectOK(\"+CFUN=1\");\n expectOK(\"+COPS=1,2,\\\"26201\\\"\");\n for (let i = 0; i < 6; i++) {\n if (bc95.sendAT(\"+CGATT?\")[0] == \"+CGATT:1\") break;\n basic.pause(1000);\n }\n }\n\n /**\n * Configure the UDP server to use for the NB-IoT messaging.\n * @param host the IP address of a server to send messages to\n * @param port the port to send messages to, eg: 5883\n */\n //% weight=208\n //% blockId=bc95_setserver block=\"set server |address %host|port %port\"\n //% parts=\"bc95\"\n export function setServer(host: string, port: number): void {\n SERVER = host;\n PORT = port;\n }\n\n /**\n * Configure the APN to use for the NB-IoT messaging.\n * @param apn the access point name, eg: internet.nbiot.telekom.de\n * @param user a user name to access the APN\n * @param password a password to access the APN\n */\n //% weight=100\n //% blockId=bc95_setapn block=\"set APN %apn|user %user|password %password\"\n //% blockExternalInputs=1\n //% parts=\"bc95\"\n export function setAPN(apn: string, user: string = null, password: string = null) {\n APN = apn;\n if (user != null && user.length > 0) USER = user;\n if (password != null && password.length > 0) PASS = password;\n }\n\n /**\n * Send an AT command to the bc95 module. Just provide the actual\n * command, not the AT prefix, like this AT(\"+CGMI?\"). Ignores the\n * AT command response completely\n * @param command the command to be sent without AT prefix\n */\n //% weight=20\n //% blockId=bc95_pushat block=\"send AT %command\"\n //% parts=\"bc95\"\n //% advanced=true\n export function pushAT(command: string): void {\n sendAT(command);\n }\n\n /**\n * Send an AT command to the bc95 module. Just provide the actual\n * command, not the AT prefix, like this AT(\"+CIMI\"). Returns the\n * first line of the response from this AT command.\n * @param command the command to be sent without AT prefix\n */\n //% weight=22\n //% blockId=bc95_sendat block=\"send AT %command and receive\"\n //% parts=\"bc95\"\n //% advanced=true\n export function expectAT(command: string): string {\n let r = sendAT(command);\n if (r.length == 0) return \"\";\n return r[0];\n }\n\n export function sendAT(command: string): Array<string> {\n basic.pause(100);\n if (DEBUG) log(\"+++\", \"AT\" + command);\n serial.writeString(\"\\r\\nAT\" + command + \"\\r\\n\");\n return receiveResponse((
"pxt.json": "{\n \"name\": \"pxt-calliope-bc95\",\n \"version\": \"0.0.1\",\n \"description\": \"NB-IoT BC95 Module\",\n \"license\": \"MIT\",\n \"dependencies\": {\n \"core\": \"*\"\n },\n \"files\": [\n \"README.md\",\n \"bc95.cpp\",\n \"bc95.ts\",\n \"_locales/de/pxt-calliope-bc95-jsdoc-strings.json\",\n \"_locales/de/pxt-calliope-bc95-strings.json\"\n ],\n \"testFiles\": [\n \"tests.ts\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/calliope-mini/pxt-calliope-bc95.git\"\n },\n \"public\": true\n}",
"tests.ts": "// this test runs on the device, connect and it will send the output on serial\n// after everything is done\n\n//% shim=pxtrt::panic\nfunction panic(code2: number): void {\n}\n\nfunction assert(msg: string, cond: boolean) {\n if (!cond) {\n bc95.log(\"ASSERT:\", msg + \" failed\");\n panic(45);\n } else {\n bc95.log(\"TEST:\", msg +\": OK\");\n }\n}\n\nconsole.log(\"START TEST\");\n\nbc95.init(SerialPin.C17, SerialPin.C16, BaudRate.BaudRate9600);\n// bc95.enableDebug(true);\n\nassert(\"modem working\",\n bc95.expectOK(\"\"));\nassert(\"enable all functionality\",\n bc95.expectOK(\"+CFUN=1\"));\nassert(\"check IMSI\",\n bc95.sendAT(\"+CIMI\")[0] == \"901405800006425\");\nassert(\"connect to network\",\n bc95.expectOK(\"+COPS=1,2,\\\"26201\\\"\"));\n// try to wait for attachment max. approx. 30s\nfor (let i = 0; i < 6; i++) {\n let response = bc95.sendAT(\"+CGATT?\");\n if (response[0] == \"+CGATT:1\") break;\n basic.pause(5000);\n}\n\nassert(\"check signal quality\",\n bc95.sendAT(\"+CSQ\")[0] != \"+CSQ:99,99\");\nassert(\"check network stats\",\n bc95.expectOK(\"+NUESTATS\"));\n\n// assert(\"set APN\",\n// bc95.expectOK(\"+CGDCONT=1,\\\"IP\\\",\\\"internet.nbiot.telekom.de\\\"\"));\nassert(\"check PDP context\",\n bc95.sendAT(\"+CGDCONT?\")[0] == \"+CGDCONT:0,\\\"IP\\\",\\\"internet.nbiot.telekom.de.MNC040.MCC901.GPRS\\\",,0,0\");\nassert(\"check address\",\n bc95.sendAT(\"+CGPADDR\")[0].substr(0,9) == \"+CGPADDR:\");\nassert(\"check band\",\n bc95.sendAT(\"+NBAND?\")[0] == \"+NBAND:8\");\nassert(\"ping external server\",\n bc95.expectOK(\"+NPING=85.214.66.173\"));\nassert(\"expect ping reply\", bc95.receiveResponse((line: string) => {\n return line.length > 7 && line.substr(0,7) == \"+NPING:\";\n})[0].length != 0);\n\nbc95.setServer(\"46.23.86.61\", 5883);\nbc95.sendNumber(\"test\", 123);\nassert(\"sending number\", bc95.sendOk());\nbc95.sendString(\"test\", \"value 123\");\nassert(\"sending string\", bc95.sendOk());\n\nserial.resetSerial();\nconsole.log(\"TEST FINISHED OK\");\n"
},
"pxt-calliope-bunt": {
"README.md": "# Calliope mini RGB Sensor (bunt)\n\nThis is a sensor package for the [PXT Calliope mini Editor](https://pxt.calliope.cc/).\n\n## Meta\n\n- PXT/calliope\n- PXT/microbit\n\n## License\n\nMIT",
"_locales/de/pxt-calliope-bunt-jsdoc-strings.json": "{\n \"sensors\": \"Lichtfarbe vom Calliope mini bunt Sensor lesen.\",\n \"sensors.calliopeBuntBlue\": \"Blauanteil aus dem Calliope mini bunt Sensor lesen.\",\n \"sensors.calliopeBuntColor\": \"Lichtfarbe vom Calliope mini bunt Sensor lesen.\",\n \"sensors.calliopeBuntGreen\": \"Grünanteil aus dem Calliope mini bunt Sensor lesen.\",\n \"sensors.calliopeBuntRed\": \"Rotanteil aus dem Calliope mini bunt Sensor lesen.\",\n \"sensors.calliopeBuntSetSensitivity\": \"Lichtempfindlichkeit des Calliope mini Farbsensors einstellen.\",\n \"sensors.calliopeBuntWhite\": \"Get RGBW values from Calliope mini RGB sensor.\",\n \"sensors.sensitivity\": \"Wandelt den Namen der Lichtempfindlichkeit in eine Zahl um.\"\n}",
"_locales/de/pxt-calliope-bunt-strings.json": "{\n \"Sensitivity.S0|block\": \"515 Lux (Nacht, extrem langsam)\",\n \"Sensitivity.S1|block\": \"1031 Lux (Abend, recht langsam)\",\n \"Sensitivity.S2|block\": \"2062 Lux (Dämmerung, langsam)\",\n \"Sensitivity.S4|block\": \"4124 Lux (Bewölkt, recht schnell)\",\n \"Sensitivity.S8|block\": \"8248 Lux (Tageslicht, schnell)\",\n \"Sensitivity.S16|block\": \"16496 Lux (Sonnenschein, sehr schnell)\",\n \"sensors.calliopeBuntColor|block\": \"Lichtfarbe\",\n \"sensors.calliopeBuntBlue|block\": \"erkannter Blauanteil\",\n \"sensors.calliopeBuntGreen|block\": \"erkannter Grünanteil\",\n \"sensors.calliopeBuntRed|block\": \"erkannter Rotanteil\",\n \"sensors.calliopeBuntWhite|block\": \"erkannte Helligkeit\",\n \"sensors.calliopeBuntSetSensitivity|block\": \"setze Lichtempfindlichkeit auf %sensitivity=sensitivity_id\",\n \"sensors.sensitivity|block\": \"%c\",\n \"sensors|block\": \"Sensoren\",\n \"{id:category}Sensors\": \"Sensoren\"\n}",
"main.ts": "enum Sensitivity {\n //% blockIdentity=calliopeBunt.sensitivity\n //% block=\"16496 Lux - 40ms\"\n S16 = 0b000,\n //% blockIdentity=calliopeBunt.sensitivity\n //% block=\"8248 Lux - 80ms\"\n S8 = 0b001,\n //% blockIdentity=calliopeBunt.sensitivity\n //% block=\"4124 Lux - 160ms\"\n S4 = 0b010,\n //% blockIdentity=calliopeBunt.sensitivity\n //% block=\"2062 Lux - 320ms\"\n S2 = 0b011,\n //% blockIdentity=calliopeBunt.sensitivity\n //% block=\"1031 Lux - 640ms\"\n S1 = 0b100,\n //% blockIdentity=calliopeBunt.sensitivity\n //% block=\"515 Lux - 1280ms\"\n S0 = 0b101,\n}\n\n/**\n * Read data from an Calliope mini RGB sensor.\n */\n//% color=#A80000\nnamespace sensors {\n const ADDRESS = 0x10;\n let colorSensitivity = Sensitivity.S4;\n\n /**\n * Converts the sensitivity name to a number.\n */\n //% blockId=sensitivity_id block=\"%c\" shim=TD_ID\n export function sensitivity(c: Sensitivity): number {\n return c;\n }\n\n /**\n * Set sensivity for the Calliope mini RGB sensor.\n */\n //% blockId=calliopeBunt_sensitivity block=\"set light sensitivity to %sensitivity=sensitivity_id\"\n //% parts=\"calliope-bunt\"\n //% trackArgs=0\n export function calliopeBuntSetSensitivity(sensitivity: number): void {\n colorSensitivity = sensitivity > Sensitivity.S0 ? Sensitivity.S0 : sensitivity;\n }\n\n /**\n * Get RGBW values from Calliope mini RGB sensor.\n */\n //% blockId=calliopeBunt_rgb block=\"read light color\"\n //% parts=\"calliope-bunt\"\n //% trackArgs=0\n export function calliopeBuntColor(): number {\n // enable the sensor, writing to the register\n pins.i2cWriteNumber(ADDRESS, (0x00 << 8) | (colorSensitivity << 4), NumberFormat.UInt16BE);\n\n // red\n pins.i2cWriteNumber(ADDRESS, 0x08, NumberFormat.Int8LE, true);\n let red = pins.map(pins.i2cReadNumber(ADDRESS, NumberFormat.UInt16LE), 0, 65535, 0, 255);\n\n // green\n pins.i2cWriteNumber(ADDRESS, 0x09, NumberFormat.Int8LE, true);\n let green = pins.map(pins.i2cReadNumber(ADDRESS, NumberFormat.UInt16LE), 0, 65535, 0, 255);\n\n // blue\n pins.i2cWriteNumber(ADDRESS, 0x0A, NumberFormat.Int8LE, true);\n let blue = pins.map(pins.i2cReadNumber(ADDRESS, NumberFormat.UInt16LE), 0, 65535, 0, 255);\n\n // white\n pins.i2cWriteNumber(ADDRESS, 0x0B, NumberFormat.Int8LE, true);\n let white = pins.map(pins.i2cReadNumber(ADDRESS, NumberFormat.UInt16LE), 0, 65535, 0, 255);\n\n // -- enable for debugging\n // serial.writeString(\"RGB[\");\n // serial.writeNumber(red);\n // serial.writeString(\",\");\n // serial.writeNumber(green);\n // serial.writeString(\",\");\n // serial.writeNumber(blue);\n // serial.writeString(\"](\");\n // serial.writeNumber(white);\n // serial.writeString(\")\\r\\n\");\n\n // shift colors down (only need the high byte)\n return basic.rgbw(red, green, blue, white);\n }\n\n /**\n * Get RGBW values from Calliope mini RGB sensor.\n */\n //% blockId=calliopeBunt_green block=\"erkannte Grün Farbe\"\n //% parts=\"calliope-bunt\"\n //% trackArgs=0\n export function calliopeBuntGreen(): number {\n // green\n pins.i2cWriteNumber(ADDRESS, 0x09, NumberFormat.Int8LE, true);\n let green = pins.map(pins.i2cReadNumber(ADDRESS, NumberFormat.UInt16LE), 0, 65535, 0, 255);\n // -- enable for debugging\n // serial.writeString(\"G[\");\n // serial.writeNumber(green);\n // serial.writeString(\"]\\r\\n\");\n return green;\n\n }\n\n /**\n * Get RGBW values from Calliope mini RGB sensor.\n */\n //% blockId=calliopeBunt_red block=\"erkannte Rot Farbe\"\n //% parts=\"calliope-bunt\"\n //% trackArgs=0\n export function calliopeBuntRed(): number {\n // red\n pins.i2cWriteNumber(ADDRESS, 0x08, NumberForm
"pxt.json": "{\n \"name\": \"pxt-calliope-bunt\",\n \"version\": \"0.0.1\",\n \"description\": \"Calliope Bunt Sensor\",\n \"license\": \"MIT\",\n \"dependencies\": {\n \"core\": \"*\"\n },\n \"files\": [\n \"README.md\",\n \"main.ts\",\n \"_locales/de/pxt-calliope-bunt-jsdoc-strings.json\",\n \"_locales/de/pxt-calliope-bunt-strings.json\"\n ],\n \"testFiles\": [\n \"tests.ts\"\n ],\n \"public\": true\n}",
"tests.ts": "sensors.calliopeBuntSetSensitivity(Sensitivity.S0);\n// read color\nbasic.forever(() => {\n let color = sensors.calliopeBuntColor();\n basic.setLedColor(color);\n});\n"
},
"blocksprj": {
"README.md": "",
"main.blocks": "<xml xmlns=\"http://www.w3.org/1999/xhtml\">\n<block type=\"device_forever\">\n<statement name=\"HANDLER\">\n<block type=\"device_show_leds\">\n<field name=\"LED00\">FALSE</field>\n<field name=\"LED10\">FALSE</field>\n<field name=\"LED20\">FALSE</field>\n<field name=\"LED30\">FALSE</field>\n<field name=\"LED40\">FALSE</field>\n<field name=\"LED01\">FALSE</field>\n<field name=\"LED11\">TRUE</field>\n<field name=\"LED21\">FALSE</field>\n<field name=\"LED31\">TRUE</field>\n<field name=\"LED41\">FALSE</field>\n<field name=\"LED02\">FALSE</field>\n<field name=\"LED12\">FALSE</field>\n<field name=\"LED22\">FALSE</field>\n<field name=\"LED32\">FALSE</field>\n<field name=\"LED42\">FALSE</field>\n<field name=\"LED03\">TRUE</field>\n<field name=\"LED13\">FALSE</field>\n<field name=\"LED23\">FALSE</field>\n<field name=\"LED33\">FALSE</field>\n<field name=\"LED43\">TRUE</field>\n<field name=\"LED04\">FALSE</field>\n<field name=\"LED14\">TRUE</field>\n<field name=\"LED24\">TRUE</field>\n<field name=\"LED34\">TRUE</field>\n<field name=\"LED44\">FALSE</field>\n<next>\n<block type=\"device_show_leds\">\n<field name=\"LED00\">FALSE</field>\n<field name=\"LED10\">FALSE</field>\n<field name=\"LED20\">FALSE</field>\n<field name=\"LED30\">FALSE</field>\n<field name=\"LED40\">FALSE</field>\n<field name=\"LED01\">FALSE</field>\n<field name=\"LED11\">FALSE</field>\n<field name=\"LED21\">FALSE</field>\n<field name=\"LED31\">FALSE</field>\n<field name=\"LED41\">FALSE</field>\n<field name=\"LED02\">FALSE</field>\n<field name=\"LED12\">FALSE</field>\n<field name=\"LED22\">FALSE</field>\n<field name=\"LED32\">FALSE</field>\n<field name=\"LED42\">FALSE</field>\n<field name=\"LED03\">FALSE</field>\n<field name=\"LED13\">FALSE</field>\n<field name=\"LED23\">FALSE</field>\n<field name=\"LED33\">FALSE</field>\n<field name=\"LED43\">FALSE</field>\n<field name=\"LED04\">FALSE</field>\n<field name=\"LED14\">FALSE</field>\n<field name=\"LED24\">FALSE</field>\n<field name=\"LED34\">FALSE</field>\n<field name=\"LED44\">FALSE</field>\n</block>\n</next>\n</block>\n</statement>\n</block>\n</xml>",
"main.ts": "basic.forever(() => {\n basic.showLeds(`\n . # . # .\n # . # . #\n # . . . #\n . # . # .\n . . # . .\n `)\n basic.showLeds(`\n . . . . .\n . . . . .\n . . . . .\n . . . . .\n . . . . .\n `)\n})",
"pxt.json": "{\n \"name\": \"{0} block\",\n \"dependencies\": {\n \"core\": \"*\",\n \"radio\": \"*\"\n },\n \"description\": \"\",\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\"\n ]\n}"
},
"bluetoothprj": {
"README.md": "",
"main.blocks": "<xml xmlns=\"http://www.w3.org/1999/xhtml\">\n<block type=\"device_forever\">\n<statement name=\"HANDLER\">\n<block type=\"device_show_leds\">\n<field name=\"LED00\">FALSE</field>\n<field name=\"LED10\">FALSE</field>\n<field name=\"LED20\">FALSE</field>\n<field name=\"LED30\">FALSE</field>\n<field name=\"LED40\">FALSE</field>\n<field name=\"LED01\">FALSE</field>\n<field name=\"LED11\">TRUE</field>\n<field name=\"LED21\">FALSE</field>\n<field name=\"LED31\">TRUE</field>\n<field name=\"LED41\">FALSE</field>\n<field name=\"LED02\">FALSE</field>\n<field name=\"LED12\">FALSE</field>\n<field name=\"LED22\">FALSE</field>\n<field name=\"LED32\">FALSE</field>\n<field name=\"LED42\">FALSE</field>\n<field name=\"LED03\">TRUE</field>\n<field name=\"LED13\">FALSE</field>\n<field name=\"LED23\">FALSE</field>\n<field name=\"LED33\">FALSE</field>\n<field name=\"LED43\">TRUE</field>\n<field name=\"LED04\">FALSE</field>\n<field name=\"LED14\">TRUE</field>\n<field name=\"LED24\">TRUE</field>\n<field name=\"LED34\">TRUE</field>\n<field name=\"LED44\">FALSE</field>\n<next>\n<block type=\"device_show_leds\">\n<field name=\"LED00\">FALSE</field>\n<field name=\"LED10\">FALSE</field>\n<field name=\"LED20\">FALSE</field>\n<field name=\"LED30\">FALSE</field>\n<field name=\"LED40\">FALSE</field>\n<field name=\"LED01\">FALSE</field>\n<field name=\"LED11\">FALSE</field>\n<field name=\"LED21\">FALSE</field>\n<field name=\"LED31\">FALSE</field>\n<field name=\"LED41\">FALSE</field>\n<field name=\"LED02\">FALSE</field>\n<field name=\"LED12\">FALSE</field>\n<field name=\"LED22\">FALSE</field>\n<field name=\"LED32\">FALSE</field>\n<field name=\"LED42\">FALSE</field>\n<field name=\"LED03\">FALSE</field>\n<field name=\"LED13\">FALSE</field>\n<field name=\"LED23\">FALSE</field>\n<field name=\"LED33\">FALSE</field>\n<field name=\"LED43\">FALSE</field>\n<field name=\"LED04\">FALSE</field>\n<field name=\"LED14\">FALSE</field>\n<field name=\"LED24\">FALSE</field>\n<field name=\"LED34\">FALSE</field>\n<field name=\"LED44\">FALSE</field>\n</block>\n</next>\n</block>\n</statement>\n</block>\n</xml>",
"main.ts": "basic.forever(() => {\n basic.showLeds(`\n . # . # .\n # . # . #\n # . . . #\n . # . # .\n . . # . .\n `)\n basic.showLeds(`\n . . . . .\n . . . . .\n . . . . .\n . . . . .\n . . . . .\n `)\n})",
"pxt.json": "{\n \"name\": \"{0} block\",\n \"dependencies\": {\n \"core\": \"*\",\n \"bluetooth\": \"*\"\n },\n \"description\": \"\",\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\"\n ]\n}"
},
"tsprj": {
"README.md": "",
"main.ts": "basic.showLeds(`\n . . . . .\n . # . # .\n . . . . .\n # . . . #\n . # # # .\n `);",
"pxt.json": "{\n \"name\": \"{0} bit\",\n \"dependencies\": {\n \"core\": \"*\",\n \"radio\": \"*\"\n },\n \"description\": \"\",\n \"files\": [\n \"main.ts\",\n \"README.md\"\n ]\n}"
}
},
"versions": {
"target": "1.0.11",
"pxt": "1.0.20"
}
}