Compare commits

...

13 Commits

Author SHA1 Message Date
895a099ebf 0.4.44 2016-10-11 19:36:36 -07:00
f7ed06108d Inputorg (#275)
* use typescript from workspace

* fixed tracking in localhost

* updated ordering of input/radio
2016-10-11 19:36:00 -07:00
0ffccdca85 Bump pxt-core to 0.4.52 2016-10-11 17:51:09 -07:00
9f5ebdfb78 Adding advanced attribute to blocks and categories (#273) 2016-10-11 13:48:25 -07:00
6e64e80c05 Revert "re-enabling sharing after bug has been fixed"
This reverts commit dde16fec14.
2016-10-11 09:37:53 -07:00
dde16fec14 re-enabling sharing after bug has been fixed 2016-10-11 09:29:44 -07:00
e1e8eab93f 0.4.43 2016-10-10 22:10:45 -07:00
dface9083f Bump pxt-core to 0.4.51 2016-10-10 22:10:43 -07:00
31d4afc897 0.4.42 2016-10-10 17:45:43 -07:00
8427e89eb6 updating to pxt 0.4.50 2016-10-10 16:31:47 -07:00
277d5a721c rename "microbit" package to "core" #414 (#270)
* rename "microbit" package to "core" #414

* shouldn't edit the package id.

* updating package.json

* updated the wrong version

* missed updating pxt.json of tests
2016-10-10 16:21:50 -07:00
80131f2928 updated tilt tempo video 2016-10-10 11:04:00 -07:00
51bd8d57aa updated raspbian docs 2016-10-09 21:50:13 -07:00
71 changed files with 223 additions and 177 deletions

View File

@ -16,5 +16,6 @@
"**/pxt_modules/**": true
},
"tslint.enable": true,
"tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib"
"tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib",
"typescript.tsdk": "./node_modules/typescript/lib"
}

View File

@ -2,5 +2,5 @@
(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f)}})(document,window.mixpanel||[]);
mixpanel.init("762fef19c053a0ea4cec43d2fecae76e", { disable_persistence: true });
if (pxtConfig) mixpanel.register({ target: pxtConfig.targetId, version: pxtConfig.targetVersion });
if (typeof pxtConfig !== "undefined") mixpanel.register({ target: pxtConfig.targetId, version: pxtConfig.targetVersion });
</script>

View File

@ -2,5 +2,5 @@
(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f)}})(document,window.mixpanel||[]);
mixpanel.init("762fef19c053a0ea4cec43d2fecae76e", { disable_persistence: true });
if (pxtConfig) mixpanel.register({ target: pxtConfig.targetId, version: pxtConfig.targetVersion });
if (typeof pxtConfig !== "undefined") mixpanel.register({ target: pxtConfig.targetId, version: pxtConfig.targetVersion });
</script>

View File

@ -20,8 +20,8 @@ Use the Accelerometer to control guitar tempo
## Duration: 30 - 45 minutes
*accelerometer controlled tempo*
https://youtu.be/h_gPkBaVkoo
TODO: add sound to video
https://youtu.be/kA0HpqCWsjs
## Blocks
```cards

View File

@ -1,20 +1,11 @@
# Raspberry Pi and Raspbian
It is possible to run the web editor or [command line interface](/cli) from Raspbian on Raspberry Pi 2 or 3.
It is possible to run the web editor or [command line interface](/cli) from Raspbian on Raspberry Pi 2 or 3
with [Raspbian Jessie with Pixel](https://www.raspberrypi.org/downloads/raspbian/).
## Web editor
The web editor requires to install IceWeasel (Firefox) as the built-in browser cannot handle it.
```
sudo apt-get install iceweasel
```
Once installed simply navigate to https://codethemicrobit.com or type
```
firefox https://codethemicrobit.com
```
Starting with **Raspbian Pixel**, Raspbian comes with Chromium. Simply open [](https://codethemicrobit.com).
## Command line

View File

@ -10,6 +10,10 @@ input.onButtonPressed(Button.A, () => {
music.playTone(0, 0);
led.plot(0, 0);
radio.sendNumber(0);
```
## Advanced
```namespaces
game.addScore(1);
images.createImage(`
. . . . .
@ -24,7 +28,8 @@ control.inBackground(() => {
});
```
## Advanced
## Bluetooth
```namespaces
devices.tellCameraTo(MesCameraEvent.TakePhoto);

View File

@ -1,5 +1,5 @@
{
"name": "microbit-bluetooth",
"name": "bluetooth",
"description": "Bluetooth services",
"files": [
"README.md",
@ -10,7 +10,7 @@
],
"public": true,
"dependencies": {
"microbit": "file:../microbit"
"core": "file:../core"
},
"yotta": {
"config": {

View File

@ -110,6 +110,7 @@ enum EventBusValue {
};
//% weight=1 color="#333333"
//% advanced=true
namespace control {
void fiberDone(void *a)
{

View File

@ -2,6 +2,7 @@
* Runtime and event utilities.
*/
//% weight=1 color="#333333"
//% advanced=true
namespace control {
/**

View File

@ -22,6 +22,7 @@ enum LedSpriteProperty {
* A single-LED sprite game engine
*/
//% color=#008272 weight=32
//% advanced=true
namespace game {
let _score: number = 0;
let _life: number = 3;

View File

@ -4,6 +4,7 @@
* Creation, manipulation and display of LED images.
*/
//% color=#5C2D91 weight=31
//% advanced=true
namespace images {
/**
* Creates an image that fits on the LED screen.

View File

@ -159,6 +159,7 @@ namespace input {
*/
//% help=input/on-pin-released weight=6 blockGap=8
//% blockId=device_pin_released block="on pin %NAME|released" icon="\uf094"
//% advanced=true
void onPinReleased(TouchPin name, Action body) {
auto pin = getPin((int)name);
if (!pin) return;
@ -171,7 +172,7 @@ namespace input {
/**
* Get the button state (pressed or not) for ``A`` and ``B``.
*/
//% help=input/button-is-pressed weight=57
//% help=input/button-is-pressed weight=60
//% block="button|%NAME|is pressed"
//% blockId=device_get_button2
//% icon="\uf192" blockGap=8
@ -190,7 +191,7 @@ namespace input {
* Get the pin state (pressed or not). Requires to hold the ground to close the circuit.
* @param name pin used to detect the touch
*/
//% help=input/pin-is-pressed weight=56
//% help=input/pin-is-pressed weight=58
//% blockId="device_pin_is_pressed" block="pin %NAME|is pressed" icon="\uf094"
//% blockGap=8
bool pinIsPressed(TouchPin name) {
@ -198,6 +199,40 @@ namespace input {
return pin && pin->isTouched();
}
int getAccelerationStrength() {
double x = uBit.accelerometer.getX();
double y = uBit.accelerometer.getY();
double z = uBit.accelerometer.getZ();
return (int)sqrt(x*x+y*y+z*z);
}
/**
* Get the acceleration value in milli-gravitys (when the board is laying flat with the screen up, x=0, y=0 and z=-1024)
* @param dimension TODO
*/
//% help=input/acceleration weight=58 icon="\uf135"
//% blockId=device_acceleration block="acceleration (mg)|%NAME" blockGap=8
//% parts="accelerometer"
int acceleration(Dimension dimension) {
switch (dimension) {
case Dimension::X: return uBit.accelerometer.getX();
case Dimension::Y: return uBit.accelerometer.getY();
case Dimension::Z: return uBit.accelerometer.getZ();
case Dimension::Strength: return getAccelerationStrength();
}
return 0;
}
/**
* Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright.
*/
//% help=input/light-level weight=57
//% blockId=device_get_light_level block="light level" blockGap=8 icon="\uf185"
//% parts="ledmatrix"
int lightLevel() {
return uBit.display.readLightLevel();
}
/**
* Get the current compass heading in degrees.
*/
@ -221,48 +256,13 @@ namespace input {
return uBit.thermometer.getTemperature();
}
int getAccelerationStrength() {
double x = uBit.accelerometer.getX();
double y = uBit.accelerometer.getY();
double z = uBit.accelerometer.getZ();
return (int)sqrt(x*x+y*y+z*z);
}
/**
* Get the acceleration value in milli-gravitys (when the board is laying flat with the screen up, x=0, y=0 and z=-1024)
* @param dimension TODO
*/
//% help=input/acceleration weight=54 icon="\uf135"
//% blockId=device_acceleration block="acceleration (mg)|%NAME" blockGap=8
//% parts="accelerometer"
int acceleration(Dimension dimension) {
switch (dimension) {
case Dimension::X: return uBit.accelerometer.getX();
case Dimension::Y: return uBit.accelerometer.getY();
case Dimension::Z: return uBit.accelerometer.getZ();
case Dimension::Strength: return getAccelerationStrength();
}
return 0;
}
/**
* Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright.
*/
//% help=input/light-level weight=53
//% blockId=device_get_light_level block="light level" blockGap=8 icon="\uf185"
//% parts="ledmatrix"
int lightLevel() {
return uBit.display.readLightLevel();
}
/**
* The pitch or roll of the device, rotation along the ``x-axis`` or ``y-axis``, in degrees.
* @param kind TODO
*/
//% help=input/rotation weight=52
//% blockId=device_get_rotation block="rotation (°)|%NAME" blockGap=8 icon="\uf197"
//% parts="accelerometer"
//% parts="accelerometer" advanced=true
int rotation(Rotation kind) {
switch (kind) {
case Rotation::Pitch: return uBit.accelerometer.getPitch();
@ -278,6 +278,7 @@ namespace input {
//% help=input/magnetic-force weight=51
//% blockId=device_get_magnetic_force block="magnetic force (µT)|%NAME" blockGap=8 icon="\uf076"
//% parts="compass"
//% advanced=true
int magneticForce(Dimension dimension) {
if (!uBit.compass.isCalibrated())
uBit.compass.calibrate();
@ -296,6 +297,7 @@ namespace input {
*/
//% help=input/running-time weight=50
//% blockId=device_get_running_time block="running time (ms)" icon="\uf017"
//% advanced=true
int runningTime() {
return system_timer_current_time();
}
@ -314,6 +316,7 @@ namespace input {
//% blockId=device_set_accelerometer_range block="set accelerometer|range %range" icon="\uf135"
//% weight=5
//% parts="accelerometer"
//% advanced=true
void setAccelerometerRange(AcceleratorRange range) {
uBit.accelerometer.setRange((int)range);
}

View File

@ -54,6 +54,7 @@ namespace led {
//% help=led/brightness weight=60
//% blockId=device_get_brightness block="brightness" icon="\uf042" blockGap=8
//% parts="ledmatrix"
//% advanced=true
int brightness() {
return uBit.display.getBrightness();
}
@ -65,6 +66,7 @@ namespace led {
//% help=led/set-brightness weight=59
//% blockId=device_set_brightness block="set brightness %value" icon="\uf042"
//% parts="ledmatrix"
//% advanced=true
void setBrightness(int value) {
uBit.display.setBrightness(value);
}
@ -75,6 +77,7 @@ namespace led {
//% weight=50 help=led/stop-animation
//% blockId=device_stop_animation block="stop animation" icon="\uf04d"
//% parts="ledmatrix"
//% advanced=true
void stopAnimation() {
uBit.display.stopAnimation();
}

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -2,6 +2,7 @@
* Control currents in Pins for analog/digital signals, servos, i2c, ...
*/
//% color=#A80000 weight=30
//% advanced=true
namespace pins {
/**
* 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.

View File

@ -1,5 +1,5 @@
{
"name": "microbit",
"name": "core",
"description": "The microbit core library",
"installedVersion": "tsmdvf",
"files": [

View File

@ -20,6 +20,7 @@ enum class BaudRate {
};
//% weight=2 color=30
//% advanced=true
namespace serial {
// note that at least one // followed by % is needed per declaration!

View File

@ -2,6 +2,7 @@
* Reading and writing data over a serial connection.
*/
//% weight=2 color=#002050
//% advanced=true
namespace serial {
/**
* Prints a line of text to the serial

View File

@ -5,6 +5,7 @@
* Creation, manipulation and display of LED images.
*/
//% color=#5C2D91 weight=31
//% advanced=true
declare namespace images {
/**
@ -247,13 +248,14 @@ declare namespace input {
* @param body the code to run when the pin is released
*/
//% help=input/on-pin-released weight=6 blockGap=8
//% blockId=device_pin_released block="on pin %NAME|released" icon="\uf094" shim=input::onPinReleased
//% blockId=device_pin_released block="on pin %NAME|released" icon="\uf094"
//% advanced=true shim=input::onPinReleased
function onPinReleased(name: TouchPin, body: () => void): void;
/**
* Get the button state (pressed or not) for ``A`` and ``B``.
*/
//% help=input/button-is-pressed weight=57
//% help=input/button-is-pressed weight=60
//% block="button|%NAME|is pressed"
//% blockId=device_get_button2
//% icon="\uf192" blockGap=8
@ -264,11 +266,28 @@ declare namespace input {
* Get the pin state (pressed or not). Requires to hold the ground to close the circuit.
* @param name pin used to detect the touch
*/
//% help=input/pin-is-pressed weight=56
//% help=input/pin-is-pressed weight=58
//% blockId="device_pin_is_pressed" block="pin %NAME|is pressed" icon="\uf094"
//% blockGap=8 shim=input::pinIsPressed
function pinIsPressed(name: TouchPin): boolean;
/**
* Get the acceleration value in milli-gravitys (when the board is laying flat with the screen up, x=0, y=0 and z=-1024)
* @param dimension TODO
*/
//% help=input/acceleration weight=58 icon="\uf135"
//% blockId=device_acceleration block="acceleration (mg)|%NAME" blockGap=8
//% parts="accelerometer" shim=input::acceleration
function acceleration(dimension: Dimension): number;
/**
* Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright.
*/
//% help=input/light-level weight=57
//% blockId=device_get_light_level block="light level" blockGap=8 icon="\uf185"
//% parts="ledmatrix" shim=input::lightLevel
function lightLevel(): number;
/**
* Get the current compass heading in degrees.
*/
@ -287,30 +306,13 @@ declare namespace input {
//% parts="thermometer" shim=input::temperature
function temperature(): number;
/**
* Get the acceleration value in milli-gravitys (when the board is laying flat with the screen up, x=0, y=0 and z=-1024)
* @param dimension TODO
*/
//% help=input/acceleration weight=54 icon="\uf135"
//% blockId=device_acceleration block="acceleration (mg)|%NAME" blockGap=8
//% parts="accelerometer" shim=input::acceleration
function acceleration(dimension: Dimension): number;
/**
* Reads the light level applied to the LED screen in a range from ``0`` (dark) to ``255`` bright.
*/
//% help=input/light-level weight=53
//% blockId=device_get_light_level block="light level" blockGap=8 icon="\uf185"
//% parts="ledmatrix" shim=input::lightLevel
function lightLevel(): number;
/**
* The pitch or roll of the device, rotation along the ``x-axis`` or ``y-axis``, in degrees.
* @param kind TODO
*/
//% help=input/rotation weight=52
//% blockId=device_get_rotation block="rotation (°)|%NAME" blockGap=8 icon="\uf197"
//% parts="accelerometer" shim=input::rotation
//% parts="accelerometer" advanced=true shim=input::rotation
function rotation(kind: Rotation): number;
/**
@ -319,14 +321,16 @@ declare namespace input {
*/
//% help=input/magnetic-force weight=51
//% blockId=device_get_magnetic_force block="magnetic force (µT)|%NAME" blockGap=8 icon="\uf076"
//% parts="compass" shim=input::magneticForce
//% parts="compass"
//% advanced=true shim=input::magneticForce
function magneticForce(dimension: Dimension): number;
/**
* Gets the number of milliseconds elapsed since power on.
*/
//% help=input/running-time weight=50
//% blockId=device_get_running_time block="running time (ms)" icon="\uf017" shim=input::runningTime
//% blockId=device_get_running_time block="running time (ms)" icon="\uf017"
//% advanced=true shim=input::runningTime
function runningTime(): number;
/**
@ -342,13 +346,15 @@ declare namespace input {
//% help=input/set-accelerometer-range
//% blockId=device_set_accelerometer_range block="set accelerometer|range %range" icon="\uf135"
//% weight=5
//% parts="accelerometer" shim=input::setAccelerometerRange
//% parts="accelerometer"
//% advanced=true shim=input::setAccelerometerRange
function setAccelerometerRange(range: AcceleratorRange): void;
}
//% weight=1 color="#333333"
//% advanced=true
declare namespace control {
/**
@ -457,7 +463,8 @@ declare namespace led {
*/
//% help=led/brightness weight=60
//% blockId=device_get_brightness block="brightness" icon="\uf042" blockGap=8
//% parts="ledmatrix" shim=led::brightness
//% parts="ledmatrix"
//% advanced=true shim=led::brightness
function brightness(): number;
/**
@ -466,7 +473,8 @@ declare namespace led {
*/
//% help=led/set-brightness weight=59
//% blockId=device_set_brightness block="set brightness %value" icon="\uf042"
//% parts="ledmatrix" shim=led::setBrightness
//% parts="ledmatrix"
//% advanced=true shim=led::setBrightness
function setBrightness(value: number): void;
/**
@ -474,7 +482,8 @@ declare namespace led {
*/
//% weight=50 help=led/stop-animation
//% blockId=device_stop_animation block="stop animation" icon="\uf04d"
//% parts="ledmatrix" shim=led::stopAnimation
//% parts="ledmatrix"
//% advanced=true shim=led::stopAnimation
function stopAnimation(): void;
/**
@ -636,6 +645,7 @@ declare namespace pins {
//% weight=2 color=30
//% advanced=true
declare namespace serial {
/**

View File

@ -1,5 +1,5 @@
{
"name": "microbit-devices",
"name": "devices",
"description": "The BLE specific services",
"files": [
"README.md",
@ -9,7 +9,7 @@
],
"public": true,
"dependencies": {
"microbit": "file:../microbit"
"core": "file:../core"
},
"yotta": {
"config": {

View File

@ -6,7 +6,7 @@
],
"public": true,
"dependencies": {
"microbit": "file:../microbit",
"microbit-radio": "file:../microbit-radio"
"core": "file:../core",
"radio": "file:../radio"
}
}

View File

@ -8,6 +8,6 @@
"public": true,
"additionalFilePath": "../../node_modules/pxt-core/libs/lang-test0",
"dependencies": {
"microbit": "file:../microbit"
"core": "file:../core"
}
}

View File

@ -7,6 +7,6 @@
],
"public": true,
"dependencies": {
"microbit": "file:../microbit"
"core": "file:../core"
}
}

View File

@ -1,5 +1,5 @@
{
"name": "microbit-radio",
"name": "radio",
"description": "The radio services",
"files": [
"README.md",
@ -10,7 +10,7 @@
],
"public": true,
"dependencies": {
"microbit": "file:../microbit"
"core": "file:../core"
},
"yotta": {
"config": {

View File

@ -104,6 +104,7 @@ namespace radio {
//% help=radio/write-value-to-serial
//% weight=3
//% blockId=radio_write_value_serial block="radio write value to serial"
//% advanced=true
void writeValueToSerial() {
if (radioEnable() != MICROBIT_OK) return;
PacketBuffer p = uBit.radio.datagram.recv();
@ -198,6 +199,7 @@ namespace radio {
//% help=radio/received-signal-strength
//% weight=40
//% blockId=radio_datagram_rssi block="radio received signal strength"
//% advanced=true
int receivedSignalStrength() {
if (radioEnable() != MICROBIT_OK) return 0;
return packet.getRSSI();
@ -208,7 +210,7 @@ namespace radio {
* @ param id the group id between ``0`` and ``255``, 1 eg
*/
//% help=radio/set-group
//% weight=10 blockGap=8
//% weight=10 blockGap=8 advanced=true
//% blockId=radio_set_group block="radio set group %ID"
void setGroup(int id) {
if (radioEnable() != MICROBIT_OK) return;
@ -222,6 +224,7 @@ namespace radio {
//% help=radio/set-transmit-power
//% weight=9 blockGap=8
//% blockId=radio_set_transmit_power block="radio set transmit power %power"
//% advanced=true
void setTransmitPower(int power) {
if (radioEnable() != MICROBIT_OK) return;
uBit.radio.setTransmitPower(power);
@ -229,10 +232,12 @@ namespace radio {
/**
* Set the radio to transmit the serial number in each message.
* @param transmit value indicating if the serial number is transmitted, eg: true
*/
//% help=radio/set-transmit-serial-number
//% weight=8 blockGap=8
//% blockId=radio_set_transmit_serial_number block="radio set transmit serial number %transmit"
//% advanced=true
void setTransmitSerialNumber(bool transmit) {
if (radioEnable() != MICROBIT_OK) return;
transmitSerialNumber = transmit;

View File

@ -38,7 +38,8 @@ declare namespace radio {
*/
//% help=radio/write-value-to-serial
//% weight=3
//% blockId=radio_write_value_serial block="radio write value to serial" shim=radio::writeValueToSerial
//% blockId=radio_write_value_serial block="radio write value to serial"
//% advanced=true shim=radio::writeValueToSerial
function writeValueToSerial(): void;
/**
@ -79,7 +80,8 @@ declare namespace radio {
*/
//% help=radio/received-signal-strength
//% weight=40
//% blockId=radio_datagram_rssi block="radio received signal strength" shim=radio::receivedSignalStrength
//% blockId=radio_datagram_rssi block="radio received signal strength"
//% advanced=true shim=radio::receivedSignalStrength
function receivedSignalStrength(): number;
/**
@ -87,7 +89,7 @@ declare namespace radio {
* @ param id the group id between ``0`` and ``255``, 1 eg
*/
//% help=radio/set-group
//% weight=10 blockGap=8
//% weight=10 blockGap=8 advanced=true
//% blockId=radio_set_group block="radio set group %ID" shim=radio::setGroup
function setGroup(id: number): void;
@ -97,15 +99,18 @@ declare namespace radio {
*/
//% help=radio/set-transmit-power
//% weight=9 blockGap=8
//% blockId=radio_set_transmit_power block="radio set transmit power %power" shim=radio::setTransmitPower
//% blockId=radio_set_transmit_power block="radio set transmit power %power"
//% advanced=true shim=radio::setTransmitPower
function setTransmitPower(power: number): void;
/**
* Set the radio to transmit the serial number in each message.
* @param transmit value indicating if the serial number is transmitted, eg: true
*/
//% help=radio/set-transmit-serial-number
//% weight=8 blockGap=8
//% blockId=radio_set_transmit_serial_number block="radio set transmit serial number %transmit" shim=radio::setTransmitSerialNumber
//% blockId=radio_set_transmit_serial_number block="radio set transmit serial number %transmit"
//% advanced=true shim=radio::setTransmitSerialNumber
function setTransmitSerialNumber(transmit: boolean): void;
}

View File

@ -7,7 +7,7 @@
],
"public": true,
"dependencies": {
"microbit": "file:../microbit",
"microbit-radio": "file:../microbit-radio"
"core": "file:../core",
"radio": "file:../radio"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "pxt-microbit",
"version": "0.4.41",
"version": "0.4.44",
"description": "micro:bit target for PXT",
"keywords": [
"JavaScript",
@ -29,6 +29,6 @@
"typescript": "^1.8.7"
},
"dependencies": {
"pxt-core": "0.4.48"
"pxt-core": "0.4.52"
}
}

View File

@ -4,12 +4,12 @@
"name": "code the micro:bit",
"title": "code the micro:bit - Blocks / Javascript editor",
"description": "A Blocks / JavaScript code editor for the micro:bit.",
"corepkg": "microbit",
"corepkg": "core",
"bundleddirs": [
"libs/microbit",
"libs/microbit-radio",
"libs/microbit-devices",
"libs/microbit-bluetooth"
"libs/core",
"libs/radio",
"libs/devices",
"libs/bluetooth"
],
"cloud": {
"workspace": false,
@ -29,8 +29,8 @@
"config": {
"name": "{0} block",
"dependencies": {
"microbit": "*",
"microbit-radio": "*"
"core": "*",
"radio": "*"
},
"description": "",
"files": [
@ -50,8 +50,8 @@
"config": {
"name": "{0} bit",
"dependencies": {
"microbit": "*",
"microbit-radio": "*"
"core": "*",
"radio": "*"
},
"description": "",
"files": [
@ -69,7 +69,23 @@
"hasHex": true,
"deployDrives": "(MICROBIT|MBED)",
"driveName": "MICROBIT",
"hexMimeType": "application/x-microbit-hex"
"hexMimeType": "application/x-microbit-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": ""
}
}
]
},
"runtime": {
"mathBlocks": true,

View File

@ -1,7 +1,7 @@
/// <reference path="../../node_modules/pxt-core/built/pxtsim.d.ts"/>
/// <reference path="../../libs/microbit/dal.d.ts"/>
/// <reference path="../../libs/microbit/shims.d.ts"/>
/// <reference path="../../libs/microbit/enums.d.ts"/>
/// <reference path="../../libs/core/dal.d.ts"/>
/// <reference path="../../libs/core/shims.d.ts"/>
/// <reference path="../../libs/core/enums.d.ts"/>
namespace pxsim.visuals {
const PIXEL_SPACING = PIN_DIST * 3;

View File

@ -6,8 +6,8 @@
],
"public": true,
"dependencies": {
"microbit": "*",
"microbit-radio": "*"
"core": "*",
"radio": "*"
},
"installedVersion": "file:."
}