Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
1c4c93dc60 | |||
d73847bfba | |||
4e46682489 | |||
ab7aa00747 | |||
2bebb6056d | |||
22046c417c | |||
dc8afa6d45 | |||
22e2ab5ad9 | |||
f365726a8e | |||
e329b3bd2e | |||
d7b709e97b | |||
9714ec46e9 | |||
20ef54f565 | |||
554df0bce9 | |||
6c89dddef6 | |||
23f91895f7 | |||
3f83cda087 | |||
7e79635413 | |||
56e1cf91ac | |||
f9f96f33f0 | |||
0b33073be1 | |||
65594842fc | |||
c6ed665f84 | |||
79462deb24 | |||
5c05f3e241 | |||
4f7dd75fbe | |||
338e507b51 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -7,6 +7,9 @@ typings
|
|||||||
tmp
|
tmp
|
||||||
temp
|
temp
|
||||||
projects/**
|
projects/**
|
||||||
|
clients/win10/app/AppPackages
|
||||||
|
clients/win10/app/BundlePackages
|
||||||
|
clients/win10/app/BundleArtifacts
|
||||||
clients/win10/app/bin
|
clients/win10/app/bin
|
||||||
clients/win10/app/bld
|
clients/win10/app/bld
|
||||||
clients/win10/*.opendb
|
clients/win10/*.opendb
|
||||||
|
@ -20,22 +20,18 @@
|
|||||||
<ProjectConfiguration Include="Release|AnyCPU">
|
<ProjectConfiguration Include="Release|AnyCPU">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>AnyCPU</Platform>
|
<Platform>AnyCPU</Platform>
|
||||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|ARM">
|
<ProjectConfiguration Include="Release|ARM">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>ARM</Platform>
|
<Platform>ARM</Platform>
|
||||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|x64">
|
<ProjectConfiguration Include="Release|x64">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>x64</Platform>
|
<Platform>x64</Platform>
|
||||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|x86">
|
<ProjectConfiguration Include="Release|x86">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>x86</Platform>
|
<Platform>x86</Platform>
|
||||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
|
BIN
clients/win10/store/desktopblocks1366x768.png
Normal file
BIN
clients/win10/store/desktopblocks1366x768.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 172 KiB |
BIN
clients/win10/store/desktopjavascript1366x768.png
Normal file
BIN
clients/win10/store/desktopjavascript1366x768.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 121 KiB |
BIN
clients/win10/store/mobileblocks480x800.png
Normal file
BIN
clients/win10/store/mobileblocks480x800.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
@ -148,12 +148,6 @@ Trim any leftover fabric, threads or tape.
|
|||||||
|
|
||||||
Your watch is ready!
|
Your watch is ready!
|
||||||
|
|
||||||
### ~avatar avatar
|
|
||||||
|
|
||||||
Excellent, you're ready to continue with the [challenges](/projects/rock-paper-scissors)!
|
|
||||||
|
|
||||||
### ~
|
|
||||||
|
|
||||||
### Acknowledgements
|
### Acknowledgements
|
||||||
|
|
||||||
Artistic design by Melinda Hoeneisen.
|
Artistic design by Melinda Hoeneisen.
|
||||||
|
@ -22,14 +22,13 @@ control.inBackground(() => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## Advanced
|
## Advanced
|
||||||
|
|
||||||
```namespaces
|
```namespaces
|
||||||
devices.tellCameraTo(MesCameraEvent.TakePhoto);
|
devices.tellCameraTo(MesCameraEvent.TakePhoto);
|
||||||
bluetooth.onBluetoothConnected(() => {});
|
bluetooth.onBluetoothConnected(() => {});
|
||||||
```
|
```
|
||||||
|
|
||||||
```package
|
```package
|
||||||
microbit-devices
|
microbit-devices
|
||||||
microbit-bluetooth
|
microbit-bluetooth
|
||||||
|
@ -9,14 +9,24 @@ led.stopAnimation()
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
This program...
|
This program sets up the ``stop animation`` part of the program,
|
||||||
|
and then shows a string that you can stop with button ``B``.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
basic.showString("STOP ME! STOP ME! PLEASE, WON'T SOMEBODY STOP ME?");
|
|
||||||
input.onButtonPressed(Button.B, () => {
|
input.onButtonPressed(Button.B, () => {
|
||||||
led.stopAnimation();
|
led.stopAnimation();
|
||||||
});
|
});
|
||||||
'```
|
basic.showString("STOP ME! STOP ME! PLEASE, WON'T SOMEBODY STOP ME?");
|
||||||
|
```
|
||||||
|
|
||||||
|
### ~hint
|
||||||
|
|
||||||
|
It's important to set up ``stop animation`` before showing the
|
||||||
|
animation, so the ``stop animation`` part of the program will be ready
|
||||||
|
to go.
|
||||||
|
|
||||||
|
### ~
|
||||||
|
|
||||||
### See Also
|
### See Also
|
||||||
|
|
||||||
|
[show animation](/reference/basic/show-animation)
|
||||||
|
3
docs/support.md
Normal file
3
docs/support.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Support
|
||||||
|
|
||||||
|
Please use the [GitHub issue tracker](https://github.com/microsoft/pxt-microbit) to report bugs.
|
@ -43,7 +43,7 @@ namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/send-number
|
//% help=radio/send-number
|
||||||
//% weight=60
|
//% weight=60
|
||||||
//% blockId=radio_datagram_send block="send number %value" blockGap=8
|
//% blockId=radio_datagram_send block="radio send number %value" blockGap=8
|
||||||
void sendNumber(int value) {
|
void sendNumber(int value) {
|
||||||
if (radioEnable() != MICROBIT_OK) return;
|
if (radioEnable() != MICROBIT_OK) return;
|
||||||
uint32_t t = system_timer_current_time();
|
uint32_t t = system_timer_current_time();
|
||||||
@ -54,13 +54,13 @@ namespace radio {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Broadcasts a name / value pair along with the device serial number
|
* Broadcasts a name / value pair along with the device serial number
|
||||||
* and running time to any connected BBC micro:bit in the group.
|
* and running time to any connected micro:bit in the group.
|
||||||
* @param name the field name (max 12 characters), eg: "data"
|
* @param name the field name (max 12 characters), eg: "data"
|
||||||
* @param value the numberic value
|
* @param value the numberic value
|
||||||
*/
|
*/
|
||||||
//% help=radio/send-value
|
//% help=radio/send-value
|
||||||
//% weight=59
|
//% weight=59
|
||||||
//% blockId=radio_datagram_send_value block="send|value %name|= %value" blockGap=8
|
//% blockId=radio_datagram_send_value block="radio send|value %name|= %value" blockGap=8
|
||||||
void sendValue(StringData* name, int value) {
|
void sendValue(StringData* name, int value) {
|
||||||
if (radioEnable() != MICROBIT_OK) return;
|
if (radioEnable() != MICROBIT_OK) return;
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/send-string
|
//% help=radio/send-string
|
||||||
//% weight=58
|
//% weight=58
|
||||||
//% blockId=radio_datagram_send_string block="send string %msg"
|
//% blockId=radio_datagram_send_string block="radio send string %msg"
|
||||||
void sendString(StringData* msg) {
|
void sendString(StringData* msg) {
|
||||||
if (radioEnable() != MICROBIT_OK) return;
|
if (radioEnable() != MICROBIT_OK) return;
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/write-value-to-serial
|
//% help=radio/write-value-to-serial
|
||||||
//% weight=3
|
//% weight=3
|
||||||
//% blockId=radio_write_value_serial block="write value to serial"
|
//% blockId=radio_write_value_serial block="radio write value to serial"
|
||||||
void writeValueToSerial() {
|
void writeValueToSerial() {
|
||||||
if (radioEnable() != MICROBIT_OK) return;
|
if (radioEnable() != MICROBIT_OK) return;
|
||||||
PacketBuffer p = uBit.radio.datagram.recv();
|
PacketBuffer p = uBit.radio.datagram.recv();
|
||||||
@ -139,7 +139,7 @@ namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/on-data-received
|
//% help=radio/on-data-received
|
||||||
//% weight=50
|
//% weight=50
|
||||||
//% blockId=radio_datagram_received_event block="on data received" blockGap=8
|
//% blockId=radio_datagram_received_event block="radio on data received" blockGap=8
|
||||||
void onDataReceived(Action body) {
|
void onDataReceived(Action body) {
|
||||||
if (radioEnable() != MICROBIT_OK) return;
|
if (radioEnable() != MICROBIT_OK) return;
|
||||||
registerWithDal(MICROBIT_ID_RADIO, MICROBIT_RADIO_EVT_DATAGRAM, body);
|
registerWithDal(MICROBIT_ID_RADIO, MICROBIT_RADIO_EVT_DATAGRAM, body);
|
||||||
@ -151,7 +151,7 @@ namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/received-number-at
|
//% help=radio/received-number-at
|
||||||
//% weight=45 debug=true
|
//% weight=45 debug=true
|
||||||
//% blockId=radio_datagram_received_number_at block="receive number|at %VALUE" blockGap=8
|
//% blockId=radio_datagram_received_number_at block="radio receive number|at %VALUE" blockGap=8
|
||||||
int receivedNumberAt(int index) {
|
int receivedNumberAt(int index) {
|
||||||
if (radioEnable() != MICROBIT_OK) return 0;
|
if (radioEnable() != MICROBIT_OK) return 0;
|
||||||
if (0 <= index && index < packet.length() / 4) {
|
if (0 <= index && index < packet.length() / 4) {
|
||||||
@ -168,7 +168,7 @@ namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/receive-number
|
//% help=radio/receive-number
|
||||||
//% weight=46
|
//% weight=46
|
||||||
//% blockId=radio_datagram_receive block="receive number" blockGap=8
|
//% blockId=radio_datagram_receive block="radio receive number" blockGap=8
|
||||||
int receiveNumber()
|
int receiveNumber()
|
||||||
{
|
{
|
||||||
if (radioEnable() != MICROBIT_OK) return 0;
|
if (radioEnable() != MICROBIT_OK) return 0;
|
||||||
@ -179,7 +179,7 @@ namespace radio {
|
|||||||
/**
|
/**
|
||||||
* Reads the next packet as a string and returns it.
|
* Reads the next packet as a string and returns it.
|
||||||
*/
|
*/
|
||||||
//% blockId=radio_datagram_receive_string block="receive string" blockGap=8
|
//% blockId=radio_datagram_receive_string block="radio receive string" blockGap=8
|
||||||
//% weight=44
|
//% weight=44
|
||||||
//% help=radio/receive-string
|
//% help=radio/receive-string
|
||||||
StringData* receiveString() {
|
StringData* receiveString() {
|
||||||
@ -194,7 +194,7 @@ namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/received-signal-strength
|
//% help=radio/received-signal-strength
|
||||||
//% weight=40
|
//% weight=40
|
||||||
//% blockId=radio_datagram_rssi block="received signal strength"
|
//% blockId=radio_datagram_rssi block="radio received signal strength"
|
||||||
int receivedSignalStrength() {
|
int receivedSignalStrength() {
|
||||||
if (radioEnable() != MICROBIT_OK) return 0;
|
if (radioEnable() != MICROBIT_OK) return 0;
|
||||||
return packet.getRSSI();
|
return packet.getRSSI();
|
||||||
@ -205,8 +205,8 @@ namespace radio {
|
|||||||
* @ param id the group id between ``0`` and ``255``, 1 eg
|
* @ param id the group id between ``0`` and ``255``, 1 eg
|
||||||
*/
|
*/
|
||||||
//% help=radio/set-group
|
//% help=radio/set-group
|
||||||
//% weight=10
|
//% weight=10 blockGap=8
|
||||||
//% blockId=radio_set_group block="set group %ID"
|
//% blockId=radio_set_group block="radio set group %ID"
|
||||||
void setGroup(int id) {
|
void setGroup(int id) {
|
||||||
if (radioEnable() != MICROBIT_OK) return;
|
if (radioEnable() != MICROBIT_OK) return;
|
||||||
uBit.radio.setGroup(id);
|
uBit.radio.setGroup(id);
|
||||||
@ -217,8 +217,8 @@ namespace radio {
|
|||||||
* @param power a value in the range 0..7, where 0 is the lowest power and 7 is the highest. eg: 7
|
* @param power a value in the range 0..7, where 0 is the lowest power and 7 is the highest. eg: 7
|
||||||
*/
|
*/
|
||||||
//% help=radio/set-transmit-power
|
//% help=radio/set-transmit-power
|
||||||
//% weight=9
|
//% weight=9 blockGap=8
|
||||||
//% blockId=radio_set_transmit_power block="set transmit power %power"
|
//% blockId=radio_set_transmit_power block="radio set transmit power %power"
|
||||||
void setTransmitPower(int power) {
|
void setTransmitPower(int power) {
|
||||||
if (radioEnable() != MICROBIT_OK) return;
|
if (radioEnable() != MICROBIT_OK) return;
|
||||||
uBit.radio.setTransmitPower(power);
|
uBit.radio.setTransmitPower(power);
|
||||||
@ -228,8 +228,8 @@ namespace radio {
|
|||||||
* Set the radio to transmit the serial number in each message.
|
* Set the radio to transmit the serial number in each message.
|
||||||
*/
|
*/
|
||||||
//% help=radio/set-transmit-serial-number
|
//% help=radio/set-transmit-serial-number
|
||||||
//% weight=8
|
//% weight=8 blockGap=8
|
||||||
//% block=radio_set_transmit_serial_number block="set tranmist serial number %transmit"
|
//% blockId=radio_set_transmit_serial_number block="radio set transmit serial number %transmit"
|
||||||
void setTransmitSerialNumber(bool transmit) {
|
void setTransmitSerialNumber(bool transmit) {
|
||||||
transmitSerialNumber = transmit;
|
transmitSerialNumber = transmit;
|
||||||
}
|
}
|
||||||
|
32
libs/microbit-radio/shims.d.ts
vendored
32
libs/microbit-radio/shims.d.ts
vendored
@ -10,18 +10,18 @@ declare namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/send-number
|
//% help=radio/send-number
|
||||||
//% weight=60
|
//% weight=60
|
||||||
//% blockId=radio_datagram_send block="send number %value" blockGap=8 shim=radio::sendNumber
|
//% blockId=radio_datagram_send block="radio send number %value" blockGap=8 shim=radio::sendNumber
|
||||||
function sendNumber(value: number): void;
|
function sendNumber(value: number): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Broadcasts a name / value pair along with the device serial number
|
* Broadcasts a name / value pair along with the device serial number
|
||||||
* and running time to any connected BBC micro:bit in the group.
|
* and running time to any connected micro:bit in the group.
|
||||||
* @param name the field name (max 12 characters), eg: "data"
|
* @param name the field name (max 12 characters), eg: "data"
|
||||||
* @param value the numberic value
|
* @param value the numberic value
|
||||||
*/
|
*/
|
||||||
//% help=radio/send-value
|
//% help=radio/send-value
|
||||||
//% weight=59
|
//% weight=59
|
||||||
//% blockId=radio_datagram_send_value block="send|value %name|= %value" blockGap=8 shim=radio::sendValue
|
//% blockId=radio_datagram_send_value block="radio send|value %name|= %value" blockGap=8 shim=radio::sendValue
|
||||||
function sendValue(name: string, value: number): void;
|
function sendValue(name: string, value: number): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,7 +29,7 @@ declare namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/send-string
|
//% help=radio/send-string
|
||||||
//% weight=58
|
//% weight=58
|
||||||
//% blockId=radio_datagram_send_string block="send string %msg" shim=radio::sendString
|
//% blockId=radio_datagram_send_string block="radio send string %msg" shim=radio::sendString
|
||||||
function sendString(msg: string): void;
|
function sendString(msg: string): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,7 +38,7 @@ declare namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/write-value-to-serial
|
//% help=radio/write-value-to-serial
|
||||||
//% weight=3
|
//% weight=3
|
||||||
//% blockId=radio_write_value_serial block="write value to serial" shim=radio::writeValueToSerial
|
//% blockId=radio_write_value_serial block="radio write value to serial" shim=radio::writeValueToSerial
|
||||||
function writeValueToSerial(): void;
|
function writeValueToSerial(): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +46,7 @@ declare namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/on-data-received
|
//% help=radio/on-data-received
|
||||||
//% weight=50
|
//% weight=50
|
||||||
//% blockId=radio_datagram_received_event block="on data received" blockGap=8 shim=radio::onDataReceived
|
//% blockId=radio_datagram_received_event block="radio on data received" blockGap=8 shim=radio::onDataReceived
|
||||||
function onDataReceived(body: () => void): void;
|
function onDataReceived(body: () => void): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,7 +55,7 @@ declare namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/received-number-at
|
//% help=radio/received-number-at
|
||||||
//% weight=45 debug=true
|
//% weight=45 debug=true
|
||||||
//% blockId=radio_datagram_received_number_at block="receive number|at %VALUE" blockGap=8 shim=radio::receivedNumberAt
|
//% blockId=radio_datagram_received_number_at block="radio receive number|at %VALUE" blockGap=8 shim=radio::receivedNumberAt
|
||||||
function receivedNumberAt(index: number): number;
|
function receivedNumberAt(index: number): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,13 +63,13 @@ declare namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/receive-number
|
//% help=radio/receive-number
|
||||||
//% weight=46
|
//% weight=46
|
||||||
//% blockId=radio_datagram_receive block="receive number" blockGap=8 shim=radio::receiveNumber
|
//% blockId=radio_datagram_receive block="radio receive number" blockGap=8 shim=radio::receiveNumber
|
||||||
function receiveNumber(): number;
|
function receiveNumber(): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the next packet as a string and returns it.
|
* Reads the next packet as a string and returns it.
|
||||||
*/
|
*/
|
||||||
//% blockId=radio_datagram_receive_string block="receive string" blockGap=8
|
//% blockId=radio_datagram_receive_string block="radio receive string" blockGap=8
|
||||||
//% weight=44
|
//% weight=44
|
||||||
//% help=radio/receive-string shim=radio::receiveString
|
//% help=radio/receive-string shim=radio::receiveString
|
||||||
function receiveString(): string;
|
function receiveString(): string;
|
||||||
@ -80,7 +80,7 @@ declare namespace radio {
|
|||||||
*/
|
*/
|
||||||
//% help=radio/received-signal-strength
|
//% help=radio/received-signal-strength
|
||||||
//% weight=40
|
//% weight=40
|
||||||
//% blockId=radio_datagram_rssi block="received signal strength" shim=radio::receivedSignalStrength
|
//% blockId=radio_datagram_rssi block="radio received signal strength" shim=radio::receivedSignalStrength
|
||||||
function receivedSignalStrength(): number;
|
function receivedSignalStrength(): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -88,8 +88,8 @@ declare namespace radio {
|
|||||||
* @ param id the group id between ``0`` and ``255``, 1 eg
|
* @ param id the group id between ``0`` and ``255``, 1 eg
|
||||||
*/
|
*/
|
||||||
//% help=radio/set-group
|
//% help=radio/set-group
|
||||||
//% weight=10
|
//% weight=10 blockGap=8
|
||||||
//% blockId=radio_set_group block="set group %ID" shim=radio::setGroup
|
//% blockId=radio_set_group block="radio set group %ID" shim=radio::setGroup
|
||||||
function setGroup(id: number): void;
|
function setGroup(id: number): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,16 +97,16 @@ declare namespace radio {
|
|||||||
* @param power a value in the range 0..7, where 0 is the lowest power and 7 is the highest. eg: 7
|
* @param power a value in the range 0..7, where 0 is the lowest power and 7 is the highest. eg: 7
|
||||||
*/
|
*/
|
||||||
//% help=radio/set-transmit-power
|
//% help=radio/set-transmit-power
|
||||||
//% weight=9
|
//% weight=9 blockGap=8
|
||||||
//% blockId=radio_set_transmit_power block="set transmit power %power" shim=radio::setTransmitPower
|
//% blockId=radio_set_transmit_power block="radio set transmit power %power" shim=radio::setTransmitPower
|
||||||
function setTransmitPower(power: number): void;
|
function setTransmitPower(power: number): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the radio to transmit the serial number in each message.
|
* Set the radio to transmit the serial number in each message.
|
||||||
*/
|
*/
|
||||||
//% help=radio/set-transmit-serial-number
|
//% help=radio/set-transmit-serial-number
|
||||||
//% weight=8
|
//% weight=8 blockGap=8
|
||||||
//% block=radio_set_transmit_serial_number block="set tranmist serial number %transmit" shim=radio::setTransmitSerialNumber
|
//% blockId=radio_set_transmit_serial_number block="radio set transmit serial number %transmit" shim=radio::setTransmitSerialNumber
|
||||||
function setTransmitSerialNumber(transmit: boolean): void;
|
function setTransmitSerialNumber(transmit: boolean): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ namespace basic {
|
|||||||
if (value < 0 || value >= 10) {
|
if (value < 0 || value >= 10) {
|
||||||
uBit.display.scroll(t, interval);
|
uBit.display.scroll(t, interval);
|
||||||
} else {
|
} else {
|
||||||
uBit.display.print(t.charAt(0), interval * 5);
|
uBit.display.printChar(t.charAt(0), interval * 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
value = Math.abs(value);
|
value = Math.abs(value);
|
||||||
|
|
||||||
if (high != 0) barGraphHigh = high;
|
if (high != 0) barGraphHigh = high;
|
||||||
else if (value > barGraphHigh || now - barGraphHighLast > 5000) {
|
else if (value > barGraphHigh || now - barGraphHighLast > 10000) {
|
||||||
barGraphHigh = value;
|
barGraphHigh = value;
|
||||||
barGraphHighLast = now;
|
barGraphHighLast = now;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pxt-microbit",
|
"name": "pxt-microbit",
|
||||||
"version": "0.3.6",
|
"version": "0.3.12",
|
||||||
"description": "BBC micro:bit target for PXT",
|
"description": "BBC micro:bit target for PXT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"JavaScript",
|
"JavaScript",
|
||||||
@ -29,6 +29,6 @@
|
|||||||
"typescript": "^1.8.7"
|
"typescript": "^1.8.7"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pxt-core": "0.3.9"
|
"pxt-core": "0.3.15"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,5 +124,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sideDoc": "getting-started"
|
"sideDoc": "getting-started"
|
||||||
|
},
|
||||||
|
"analytics": {
|
||||||
|
"userVoiceApiKey": "WEkkIGaj1WtJnSUF59iwaA",
|
||||||
|
"userVoiceForumId": 402381
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ namespace pxsim.basic {
|
|||||||
clearScreen();
|
clearScreen();
|
||||||
pause(interval * 5);
|
pause(interval * 5);
|
||||||
} else {
|
} else {
|
||||||
if (s.length == 1) showLeds(createImageFromString(s), interval * 5)
|
if (s.length == 1) showLeds(createImageFromString(s + " "), interval * 5)
|
||||||
else ImageMethods.scrollImage(createImageFromString(s + " "), 1, interval);
|
else ImageMethods.scrollImage(createImageFromString(s + " "), 1, interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -725,6 +725,7 @@ namespace pxsim.ImageMethods {
|
|||||||
board().animationQ.enqueue({
|
board().animationQ.enqueue({
|
||||||
interval: interval,
|
interval: interval,
|
||||||
frame: () => {
|
frame: () => {
|
||||||
|
//TODO: support right to left.
|
||||||
if (off >= leds.width || off < 0) return false;
|
if (off >= leds.width || off < 0) return false;
|
||||||
stride > 0 ? display.shiftLeft(stride) : display.shiftRight(-stride);
|
stride > 0 ? display.shiftLeft(stride) : display.shiftRight(-stride);
|
||||||
let c = Math.min(stride, leds.width - off);
|
let c = Math.min(stride, leds.width - off);
|
||||||
|
@ -612,9 +612,9 @@ svg.sim.grayscale {
|
|||||||
|
|
||||||
private attachEvents() {
|
private attachEvents() {
|
||||||
Runtime.messagePosted = (msg) => {
|
Runtime.messagePosted = (msg) => {
|
||||||
switch (msg.type || '') {
|
switch (msg.type || "") {
|
||||||
case 'serial': this.flashSystemLed(); break;
|
case "serial": this.flashSystemLed(); break;
|
||||||
case 'radiopacket': this.flashAntenna(); break;
|
case "radiopacket": this.flashAntenna(); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let tiltDecayer = 0;
|
let tiltDecayer = 0;
|
||||||
|
@ -600,7 +600,8 @@ namespace pxsim {
|
|||||||
Runtime.postMessage(<SimulatorSerialMessage>{
|
Runtime.postMessage(<SimulatorSerialMessage>{
|
||||||
type: "serial",
|
type: "serial",
|
||||||
data: this.serialOutBuffer,
|
data: this.serialOutBuffer,
|
||||||
id: runtime.id
|
id: runtime.id,
|
||||||
|
sim: true
|
||||||
})
|
})
|
||||||
this.serialOutBuffer = ""
|
this.serialOutBuffer = ""
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user