Compare commits

..

33 Commits

Author SHA1 Message Date
Sam El-Husseini
372ddfa641 0.7.47 2017-01-28 22:46:03 -08:00
Sam El-Husseini
30078923a3 Bump pxt-core to 0.11.3 2017-01-28 22:46:02 -08:00
Sam El-Husseini
5ab9222200 0.7.46 2017-01-28 21:59:48 -08:00
Sam El-Husseini
8ae5a48f1e Bump pxt-core to 0.11.2 2017-01-28 21:59:48 -08:00
Sam El-Husseini
f9ed37d07b Using pxtsemantic optimization 2017-01-28 21:55:48 -08:00
Peli de Halleux
edfbc4da18 0.7.45 2017-01-28 11:57:24 -08:00
Peli de Halleux
3a1c6a6ce3 Bump pxt-core to 0.11.1 2017-01-28 11:57:22 -08:00
Richard Knoll
9a4a2264fa Fixing singal strength docs and adding an example (#347) 2017-01-28 19:53:36 +00:00
Sam El-Husseini
e9558ce158 Fix svg scaling issue in IE. (#348)
* Fix svg scaling issue in IE. Fixes #1192

* minor fix
2017-01-28 19:53:05 +00:00
Sam El-Husseini
50677fadc4 Applying IE/Edge blockly css workaround 2017-01-26 14:47:15 -08:00
Richard Knoll
649e8f7c0f Fix neopixel transform in firefox (#345) 2017-01-26 02:51:26 +00:00
Peli de Halleux
0cb9c28f8d Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-23 03:54:58 -08:00
Peli de Halleux
004d9b4315 Adding pxt-microbit-GY521 repo 2017-01-23 03:52:53 -08:00
Sam El-Husseini
7a5b3aba01 Add hasAudio flag 2017-01-21 16:25:46 -08:00
Peli de Halleux
dc30263642 0.7.44 2017-01-20 15:42:48 -08:00
Peli de Halleux
619658a057 Bump pxt-core to 0.10.15 2017-01-20 15:42:46 -08:00
Peli de Halleux
472846bf3c 0.7.43 2017-01-20 15:16:42 -08:00
Peli de Halleux
ac4fbc850b Bump pxt-core to 0.10.14 2017-01-20 15:16:40 -08:00
Peli de Halleux
c7054b7ee0 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-20 15:16:29 -08:00
Sam El-Husseini
559a43e17b 0.7.42 2017-01-20 15:05:50 -08:00
Sam El-Husseini
7671bc46ad Bump pxt-core to 0.10.13 2017-01-20 15:05:49 -08:00
Guillaume Jenkins
b3c5f2926d Electron release 0.7.41 2017-01-20 11:02:59 -08:00
Peli de Halleux
28830aa905 more info on on-start 2017-01-19 17:51:48 -08:00
Brahma Giri Abhijith Chatra
7fbbb5e65a release of beta 2017-01-19 16:55:20 -08:00
Peli de Halleux
51ebc29887 0.7.41 2017-01-19 16:09:32 -08:00
Peli de Halleux
f5d1722eae Bump pxt-core to 0.10.11 2017-01-19 16:09:29 -08:00
Michal Moskal
5f876d5ea9 Add openocd script (for pxt gdb) 2017-01-19 17:24:03 +00:00
Michal Moskal
31de8892fa Use standard type names
otherwise compilation fails on some yotta installs
2017-01-19 17:23:51 +00:00
Peli de Halleux
0d0a68122d 0.7.40 2017-01-19 00:19:15 -08:00
Peli de Halleux
4ad660568e Bump pxt-core to 0.10.10 2017-01-19 00:19:14 -08:00
Peli de Halleux
58e82a571d 0.7.39 2017-01-18 16:14:11 -08:00
Peli de Halleux
e629b866d5 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-18 16:13:08 -08:00
Peli de Halleux
f0ac2b7a05 fixing debug message 2017-01-18 16:12:58 -08:00
15 changed files with 52 additions and 23 deletions

View File

@@ -2,6 +2,10 @@
### @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
for (let i = 0;i<5;++i) {}
if (true){}

View File

@@ -16,7 +16,13 @@ input.onButtonPressed(Button.A, () => {
led.setBrightness(50)
```
## What about JavaScript?
``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.

View File

@@ -1,3 +1,3 @@
{
"appref": "v0.6.36"
"appref": "v0.7.41"
}

View File

@@ -21,7 +21,7 @@ To add or remove the parts of the packet from the block, try clicking the blue g
* `receivedString` - The [string](/reference/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value)
* `time` - The system time of the @boardname@ that sent this packet at the time the packet was sent.
* `serial` - The serial number of the @boardname@ that sent this packet or `0` if the @boardname@ did not include its serial number.
* `signal` - How strong the radio signal is from `255` (weak) to `0` (strong).
* `signal` - How strong the radio signal is from `-128` (weak) to `-42` (strong).
### Example
@@ -39,6 +39,23 @@ radio.onDataPacketReceived(({ receivedNumber }) => {
})
```
### Example
This program uses the signal strength from received packets to graph the
approximate distance between two @boardname@s.
```blocks
basic.forever(() => {
radio.sendNumber(0)
})
radio.onDataPacketReceived(({ signal, receivedNumber }) => {
led.plotBarGraph(
Math.abs(signal + 42),
128 - 42
)
})
```
### See also
[send number](/reference/radio/send-number),

View File

@@ -2,8 +2,8 @@
> Note: This API has been deprecated! Use [on data packet received](/reference/radio/on-data-packet-received) instead.
Find how strong the ``radio`` signal is, from `255` to `0`.
(`255` means a weak signal and `0` means a strong one.)
Find how strong the ``radio`` signal is, from `-128` to `-42`.
(`-128` means a weak signal and `-42` means a strong one.)
The @boardname@ finds the signal strength by checking how strong it was
the last time it ran the
@@ -16,7 +16,7 @@ radio.receivedSignalStrength();
### Returns
* a [number](/reference/types/number) between `255` and `0` that means
* a [number](/reference/types/number) between `-128` and `-42` that means
how strong the signal is.
### Simulator

View File

@@ -11,8 +11,7 @@
aria-labelledby="title desc"
xml:space="preserve"
enable-background="new 0 0 280 32.755"
height="52.672001"
width="52.672001"
viewBox="0 0 52.672001 52.672001"
version="1.1"
id="svg2"
inkscape:version="0.91 r13725"

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -11,8 +11,7 @@
aria-labelledby="title desc"
xml:space="preserve"
enable-background="new 0 0 280 32.755"
height="52.672001"
width="52.672001"
viewBox="0 0 52.672001 52.672001"
version="1.1"
id="svg2"
inkscape:version="0.91 r13725"

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,9 +1,9 @@
{
"versions": {
"0": {
"latest": "v0.7.29",
"latest": "v0.7.41",
"banned": [],
"prompt": "v0.7.29"
"prompt": "v0.7.41"
}
}
}

View File

@@ -338,10 +338,10 @@ namespace pxt {
void Segment::print()
{
printf("Segment: %x, length: %u, size: %u\n", data, (uint)length, (uint)size);
for(uint i = 0; i < size; i++)
printf("Segment: %x, length: %u, size: %u\n", data, (uint32_t)length, (uint32_t)size);
for(uint32_t i = 0; i < size; i++)
{
printf("%d ",(uint)data[i]);
printf("%d ",(uint32_t)data[i]);
}
printf("\n");
}

View File

@@ -1,6 +1,6 @@
{
"name": "pxt-microbit",
"version": "0.7.38",
"version": "0.7.47",
"description": "micro:bit target for PXT",
"keywords": [
"JavaScript",
@@ -36,6 +36,6 @@
"semantic-ui-less": "^2.2.4"
},
"dependencies": {
"pxt-core": "0.10.9"
"pxt-core": "0.11.3"
}
}

View File

@@ -28,6 +28,7 @@
"deployDrives": "(MICROBIT|MBED)",
"driveName": "MICROBIT",
"hexMimeType": "application/x-microbit-hex",
"openocdScript": "source [find interface/cmsis-dap.cfg]; source [find target/nrf51.cfg]",
"upgrades": [
{
"type": "package",
@@ -329,6 +330,7 @@
"invertedMenu": true,
"coloredToolbox": true,
"monacoToolbox": true,
"hasAudio": true,
"blocklyOptions": {
"grid": {
"spacing": 45,
@@ -338,4 +340,4 @@
}
}
}
}
}

View File

@@ -28,7 +28,7 @@ namespace pxsim {
this.data = data;
}
public print() {
pxt.debug(`Image id:${this.id} refs:${this.refcnt} size:${this.width}x${Image.height}`)
// console.debug(`Image id:${this.id} refs:${this.refcnt} size:${this.width}x${Image.height}`)
}
public get(x: number, y: number): number {
if (x < 0 || x >= this.width || y < 0 || y >= 5) return 0;

View File

@@ -179,6 +179,7 @@ namespace pxsim.visuals {
.sim-neopixel-canvas-parent:hover {
transform-origin: center;
transform: scale(4) translateY(-60px);
-moz-transform: scale(4) translateY(-220px);
}
.sim-neopixel-canvas .hidden {
visibility:hidden;

View File

@@ -5,7 +5,8 @@
"microbit-foundation"
],
"approvedRepos": [
"CoderDojoOlney/pxt-olney"
"CoderDojoOlney/pxt-olney",
"PaulDFoster/pxt-microbit-GY521"
]
}
}

View File

@@ -1,5 +1,5 @@
/* Import all components */
@import 'semantic';
@import 'pxtsemantic';
@import 'pxt';
@import 'themes/default/globals/site.variables';
@import 'themes/pxt/globals/site.variables';
@@ -45,7 +45,7 @@
Blockly
*******************************/
.blocklyTreeRow {
div.blocklyTreeRow {
border-bottom: 1px solid #ecf0f1 !important;
margin-bottom: 0px !important;
@@ -56,7 +56,7 @@
}
/* Blockly toolbox font size same as the page font */
.blocklyTreeLabel {
span.blocklyTreeLabel {
font-family: @pageFont !important;
font-weight: 200;
}