Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
472846bf3c | ||
|
|
ac4fbc850b | ||
|
|
c7054b7ee0 | ||
|
|
559a43e17b | ||
|
|
7671bc46ad | ||
|
|
b3c5f2926d | ||
|
|
28830aa905 | ||
|
|
7fbbb5e65a | ||
|
|
51ebc29887 | ||
|
|
f5d1722eae | ||
|
|
5f876d5ea9 | ||
|
|
31de8892fa |
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
### @description Language constructs for the Block editor.
|
### @description Language constructs for the Block editor.
|
||||||
|
|
||||||
|
Blocks snap into each other to define the program that your @boardname@ will run.
|
||||||
|
Blocks can be event (buttons, shake, ...) or need to be snapped into an event to run.
|
||||||
|
The [on-start](/blocks/on-start) event runs first.
|
||||||
|
|
||||||
```namespaces
|
```namespaces
|
||||||
for (let i = 0;i<5;++i) {}
|
for (let i = 0;i<5;++i) {}
|
||||||
if (true){}
|
if (true){}
|
||||||
|
|||||||
@@ -16,7 +16,13 @@ input.onButtonPressed(Button.A, () => {
|
|||||||
led.setBrightness(50)
|
led.setBrightness(50)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## What about JavaScript?
|
## What about JavaScript?
|
||||||
|
|
||||||
``on-start`` only exists in the block editor. In JavaScript, all code executes sequentially from the first line.
|
``on-start`` only exists in the block editor. In JavaScript, all code executes sequentially from the first line.
|
||||||
|
|
||||||
|
## Hey, my events moved!
|
||||||
|
|
||||||
|
When we transform the blocks into JavaScript, we always place all the event registrations (buttons, shake, ...)
|
||||||
|
before launching the ``on start`` code.
|
||||||
|
|
||||||
|
If a block from ``on start`` pauses, other registered events will have the opportunity to run as well.
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"appref": "v0.6.36"
|
"appref": "v0.7.41"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"versions": {
|
"versions": {
|
||||||
"0": {
|
"0": {
|
||||||
"latest": "v0.7.29",
|
"latest": "v0.7.41",
|
||||||
"banned": [],
|
"banned": [],
|
||||||
"prompt": "v0.7.29"
|
"prompt": "v0.7.41"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -338,10 +338,10 @@ namespace pxt {
|
|||||||
|
|
||||||
void Segment::print()
|
void Segment::print()
|
||||||
{
|
{
|
||||||
printf("Segment: %x, length: %u, size: %u\n", data, (uint)length, (uint)size);
|
printf("Segment: %x, length: %u, size: %u\n", data, (uint32_t)length, (uint32_t)size);
|
||||||
for(uint i = 0; i < size; i++)
|
for(uint32_t i = 0; i < size; i++)
|
||||||
{
|
{
|
||||||
printf("%d ",(uint)data[i]);
|
printf("%d ",(uint32_t)data[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "pxt-microbit",
|
"name": "pxt-microbit",
|
||||||
"version": "0.7.40",
|
"version": "0.7.43",
|
||||||
"description": "micro:bit target for PXT",
|
"description": "micro:bit target for PXT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"JavaScript",
|
"JavaScript",
|
||||||
@@ -36,6 +36,6 @@
|
|||||||
"semantic-ui-less": "^2.2.4"
|
"semantic-ui-less": "^2.2.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pxt-core": "0.10.10"
|
"pxt-core": "0.10.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
"deployDrives": "(MICROBIT|MBED)",
|
"deployDrives": "(MICROBIT|MBED)",
|
||||||
"driveName": "MICROBIT",
|
"driveName": "MICROBIT",
|
||||||
"hexMimeType": "application/x-microbit-hex",
|
"hexMimeType": "application/x-microbit-hex",
|
||||||
|
"openocdScript": "source [find interface/cmsis-dap.cfg]; source [find target/nrf51.cfg]",
|
||||||
"upgrades": [
|
"upgrades": [
|
||||||
{
|
{
|
||||||
"type": "package",
|
"type": "package",
|
||||||
|
|||||||
Reference in New Issue
Block a user