Compare commits

...

56 Commits

Author SHA1 Message Date
472846bf3c 0.7.43 2017-01-20 15:16:42 -08:00
ac4fbc850b Bump pxt-core to 0.10.14 2017-01-20 15:16:40 -08:00
c7054b7ee0 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-20 15:16:29 -08:00
559a43e17b 0.7.42 2017-01-20 15:05:50 -08:00
7671bc46ad Bump pxt-core to 0.10.13 2017-01-20 15:05:49 -08:00
b3c5f2926d Electron release 0.7.41 2017-01-20 11:02:59 -08:00
28830aa905 more info on on-start 2017-01-19 17:51:48 -08:00
7fbbb5e65a release of beta 2017-01-19 16:55:20 -08:00
51ebc29887 0.7.41 2017-01-19 16:09:32 -08:00
f5d1722eae Bump pxt-core to 0.10.11 2017-01-19 16:09:29 -08:00
5f876d5ea9 Add openocd script (for pxt gdb) 2017-01-19 17:24:03 +00:00
31de8892fa Use standard type names
otherwise compilation fails on some yotta installs
2017-01-19 17:23:51 +00:00
0d0a68122d 0.7.40 2017-01-19 00:19:15 -08:00
4ad660568e Bump pxt-core to 0.10.10 2017-01-19 00:19:14 -08:00
58e82a571d 0.7.39 2017-01-18 16:14:11 -08:00
e629b866d5 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-18 16:13:08 -08:00
f0ac2b7a05 fixing debug message 2017-01-18 16:12:58 -08:00
e3c8db28e4 0.7.38 2017-01-18 14:48:43 -08:00
2c0e19a120 Bump pxt-core to 0.10.9 2017-01-18 14:48:42 -08:00
595eb788b2 removed console.log for pxt.debug 2017-01-17 16:51:21 -08:00
2e15d22e9e 0.7.37 2017-01-17 16:29:52 -08:00
57082654a9 0.7.36 2017-01-17 14:55:44 -08:00
8cbf7d38e3 0.7.35 2017-01-17 14:51:28 -08:00
a99a7325bf 0.7.34 2017-01-17 14:13:06 -08:00
fa3ed9dd21 0.7.33 2017-01-17 11:37:35 -08:00
45fd40a553 adding on pin pressed in getting-started 2017-01-17 11:37:20 -08:00
5a18bea9eb 0.7.32 2017-01-17 11:28:38 -08:00
d310312841 Bump pxt-core to 0.10.8 2017-01-17 11:28:35 -08:00
a4b93f7199 support for deletable on start 2017-01-17 11:18:22 -08:00
538a4b7bbf 0.7.31 2017-01-13 18:11:03 -08:00
0078e7bc12 Bump pxt-core to 0.10.7 2017-01-13 18:11:02 -08:00
d2726133a9 Revert "Control event value in simulator (#343)"
This reverts commit 00f4c9cbb3.
2017-01-13 18:04:38 -08:00
00f4c9cbb3 Control event value in simulator (#343)
* implement pxsim.control.eventValue and pxsim.control.eventTimestamp in the simulator
2017-01-13 16:46:52 -08:00
e15da5dee1 0.7.30 2017-01-13 15:47:16 -08:00
85dda4ea84 Bump pxt-core to 0.10.4 2017-01-13 15:47:15 -08:00
a3ffe4e1cf Set latest Electron to 0.7.29 (#342) 2017-01-13 14:11:46 -08:00
90c4d4f73b 0.7.29 2017-01-13 13:55:44 -08:00
6484d559d6 Bump pxt-core to 0.10.2 2017-01-13 13:55:43 -08:00
357436f14d refactored servostate (#341)
* refactored servostate

* Bump pxt-core to 0.10.1
2017-01-12 23:09:53 -08:00
85fe96b3fd 0.7.28 2017-01-12 16:08:35 -08:00
cdac932c42 Bump pxt-core to 0.9.5 2017-01-12 16:08:32 -08:00
dcfc2a110d Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-12 16:07:19 -08:00
e9561f54c3 removing custom loader logic 2017-01-12 16:07:10 -08:00
86f6b58d38 fix"string compare works differently in simulator/on target" (#340)
* fix for "string compare works differently in simulator/on target", fixes #901
2017-01-12 15:50:39 -08:00
eee52a5c04 0.7.27 2017-01-12 15:27:07 -08:00
1a0b0eac71 Bump pxt-core to 0.9.4 2017-01-12 15:27:04 -08:00
5a98ae0bb8 0.7.26 2017-01-12 11:54:33 -08:00
a9eea9a618 Bump pxt-core to 0.9.3 2017-01-12 11:54:30 -08:00
3086c521e3 0.7.25 2017-01-12 11:33:08 -08:00
6788f79650 Bump pxt-core to 0.9.2 2017-01-12 11:33:05 -08:00
5900239045 changing editor button colors 2017-01-12 10:45:39 -08:00
248267ec2c 0.7.24 2017-01-10 17:47:09 -08:00
9429075555 Bump pxt-core to 0.8.14 2017-01-10 17:47:07 -08:00
1fa871f2e7 Support for serial events (#339)
* added "serial->on data received"

* updated info

* updated docs

* added readline to read entire buffer

* lazy initialize of serial buffers

* init async on event

* updated docs
2017-01-10 16:27:02 -08:00
04dab7df2c One letter showString shouldn't disappear (#338)
* Fix for "One letter showString shouldn't disappear", fixes #798

* miss semicolon
2017-01-10 16:25:40 -08:00
b6474467bc Electron release (#333)
Set latest Electron app release to 0.7.23
2017-01-10 14:16:13 -08:00
16 changed files with 62 additions and 82 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

@ -31,6 +31,7 @@ and press **A** to scroll your text.
### Step 5
Place more blocks to display a smiley when button **B** is pressed.
Use the dropdown to find ``B``!
```block
input.onButtonPressed(Button.B, () => {
@ -59,3 +60,15 @@ input.onGesture(Gesture.Shake, () => {
`)
})
```
### Step 7
Drag more blocks to display a random number when pin ``P0`` is touched.
Hold your right thumb on the ``GND`` metal pin
at press the ``0`` pin with your right hand to trigger this event.
```block
input.onPinPressed(TouchPin.P0, () => {
basic.showNumber(Math.random(7))
})
```

View File

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

View File

@ -1,3 +1,4 @@
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="pxt-on-start"></block>
<block type="device_forever"></block>
</xml>

View File

@ -21,7 +21,12 @@ namespace String_ {
//%
int compare(StringData *s, StringData *that) {
return strcmp(s->data, that->data);
int compareResult = strcmp(s->data, that->data);
if (compareResult < 0)
return -1;
else if (compareResult > 0)
return 1;
return 0;
}
//%

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.23",
"version": "0.7.43",
"description": "micro:bit target for PXT",
"keywords": [
"JavaScript",
@ -36,6 +36,6 @@
"semantic-ui-less": "^2.2.4"
},
"dependencies": {
"pxt-core": "0.8.13"
"pxt-core": "0.10.14"
}
}

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",
@ -72,7 +73,8 @@
"logicBlocks": true,
"variablesBlocks": true,
"onStartColor": "#0078D7",
"onStartNamespace": "basic"
"onStartNamespace": "basic",
"onStartWeight": 54
},
"simulator": {
"autoRun": true,
@ -337,4 +339,4 @@
}
}
}
}
}

View File

@ -14,7 +14,6 @@ namespace pxsim {
radioState: RadioState;
// TODO: not singletons
neopixelState: NeoPixelState;
servosState: MicroServosState;
fileSystem: FileSystemState;
constructor() {
@ -53,7 +52,13 @@ namespace pxsim {
0,
DAL.MICROBIT_ID_IO_P19,
DAL.MICROBIT_ID_IO_P20
]
],
servos: {
"P0": DAL.MICROBIT_ID_IO_P0,
"P1": DAL.MICROBIT_ID_IO_P1,
"P2": DAL.MICROBIT_ID_IO_P2,
"P3": DAL.MICROBIT_ID_IO_P3
}
});
this.builtinParts["radio"] = this.radioState = new RadioState(runtime);
this.builtinParts["accelerometer"] = this.accelerometerState = new AccelerometerState(runtime);
@ -62,12 +67,7 @@ namespace pxsim {
this.builtinParts["lightsensor"] = this.lightSensorState = new LightSensorState();
this.builtinParts["compass"] = this.compassState = new CompassState();
this.builtinParts["neopixel"] = this.neopixelState = new NeoPixelState();
this.builtinParts["microservo"] = this.servosState = new MicroServosState({
"P0": DAL.MICROBIT_ID_IO_P0,
"P1": DAL.MICROBIT_ID_IO_P1,
"P2": DAL.MICROBIT_ID_IO_P2,
"P3": DAL.MICROBIT_ID_IO_P3
});
this.builtinParts["microservo"] = this.edgeConnectorState;
this.builtinVisuals["buttonpair"] = () => new visuals.ButtonPairView();
this.builtinVisuals["ledmatrix"] = () => new visuals.LedMatrixView();

View File

@ -76,8 +76,7 @@ namespace pxsim.pins {
if (!pin) return;
analogSetPeriod(pinId, 20000);
const state = board().servosState.servoState(pinId);
state.setAngle(value);
pin.servoAngle = value;
}
export function servoSetPulse(pinId: number, micros: number) {

View File

@ -28,7 +28,7 @@ namespace pxsim {
this.data = data;
}
public print() {
console.log(`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;
@ -228,7 +228,7 @@ namespace pxsim.basic {
clearScreen();
pause(interval * 5);
} else {
if (s.length == 1) showLeds(createImageFromString(s + " "), interval * 5)
if (s.length == 1) showLeds(createImageFromString(s), 0);
else ImageMethods.scrollImage(createImageFromString(s + " "), 1, interval);
}
}

View File

@ -1,56 +1,3 @@
/*******************************
Site Overrides
*******************************/
.ui.loader:before {
border: none;
border-radius: 0px;
box-shadow: none;
}
.ui.loader:after {
border: none;
box-shadow: none;
border-radius: 0px;
margin: 40px auto;
background: transparent data-uri("static/loader.svg") no-repeat center center;
background-size: 100%;
-webkit-animation: loader-pxt @loaderSpeed infinite ease-in-out;
animation: loader-pxt @loaderSpeed infinite ease-in-out;
}
@-webkit-keyframes loader-pxt {
0% {
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(0deg);
transform: perspective(160px) rotateX(0deg) rotateY(0deg);
opacity: 0}
15% {
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(-@loaderAngle);
transform: perspective(160px) rotateX(0deg) rotateY(-@loaderAngle); }
50% {
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(@loaderAngle);
transform: perspective(160px) rotateX(0deg) rotateY(@loaderAngle);
opacity: 1}
100% {
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(0deg);
transform: perspective(160px) rotateX(0deg) rotateY(0deg);
opacity: 0}
}
@keyframes loader-pxt {
0% {
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(0deg);
transform: perspective(160px) rotateX(0deg) rotateY(0deg);
opacity: 0}
15% {
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(-10deg);
transform: perspective(160px) rotateX(0deg) rotateY(-10deg); }
50% {
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(10deg);
transform: perspective(160px) rotateX(0deg) rotateY(10deg);
opacity: 1}
100% {
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(0deg);
transform: perspective(160px) rotateX(0deg) rotateY(0deg);
opacity: 0}
}

View File

@ -1,8 +1,3 @@
/*******************************
User Variable Overrides
*******************************/
@loaderSpeed: 2s;
@loaderAngle: 5deg;
@large : 200px;

View File

@ -29,10 +29,18 @@
&:extend(.orange all);
}
.ui.button.editortools-btn {
&:extend(.blue all);
}
#filelist, #editortools {
background: #fff url(https://az742082.vo.msecnd.net/pub/psopafpj) 0 0 repeat !important;
}
#downloadArea {
background: transparent !important;
}
/*******************************
Blockly
*******************************/