Compare commits

...

18 Commits

Author SHA1 Message Date
Peli de Halleux
43456e9a53 0.2.170 2016-06-16 16:09:22 -07:00
Peli de Halleux
081244218f Bump pxt-core to 0.2.182 2016-06-16 16:09:20 -07:00
Ron Hale-Evans
6ae39f192b Examples now set to same radio group 2016-06-16 15:33:35 -07:00
Ron Hale-Evans
ed5263f248 First draft; need to debug examples 2016-06-16 15:15:14 -07:00
Peli de Halleux
f1ee861eb4 0.2.169 2016-06-16 13:24:54 -07:00
Peli de Halleux
2ce2fd95ba Bump pxt-core to 0.2.181 2016-06-16 13:24:52 -07:00
Tom Ball
741f94ce6c typo fixed 2016-06-16 16:21:59 -04:00
Peli de Halleux
4b7e415ae7 fixing package 2016-06-16 13:18:37 -07:00
Tom Ball
3efbb4fbde Merge remote-tracking branch 'origin/master'
# Conflicts:
#	package.json
2016-06-16 16:16:08 -04:00
Tom Ball
4d9450dd06 getting started 2016-06-16 16:15:24 -04:00
Ron Hale-Evans
910870e46f Edited for simpler language 2016-06-16 12:52:47 -07:00
Peli de Halleux
b664df4208 0.2.168 2016-06-16 12:12:48 -07:00
Peli de Halleux
c660277a23 Bump pxt-core to 0.2.180 2016-06-16 12:12:46 -07:00
Tom Ball
0416d88d59 Merge remote-tracking branch 'origin/master' 2016-06-16 14:56:37 -04:00
Tom Ball
4f822e3cda update 2016-06-16 14:46:48 -04:00
Peli de Halleux
20d4e473ff finishing with link to projects 2016-06-16 09:50:12 -07:00
Peli de Halleux
e45190922e 0.2.167 2016-06-16 08:51:37 -07:00
Peli de Halleux
1df118fa19 more docs on running locally 2016-06-16 08:01:28 -07:00
6 changed files with 35 additions and 20 deletions

View File

@@ -13,6 +13,7 @@ PXT ([Microsoft Programming Experience Toolkit](https://github.com/Microsoft/pxt
The following commands are a 1-time setup after synching the repo on your machine.
* clone this repo to your computer
* install the PXT command line
```
npm install -g pxt

View File

@@ -11,8 +11,9 @@ to make real programs that work!
### Happy face
There are three blocks in the editor (the area to the left).
Arrange them to look like this:
Use the **Basic** drawer in the editor (to the left)
to drag out and arrange three blocks (two `show leds` and one `forever` block)
to create this program:
```blocks
basic.forever(() => {
@@ -33,7 +34,7 @@ basic.forever(() => {
});
```
When you run this program, you will see a smiley face, then a blank
When you run this program (click the **Play** button) you will see a smiley face, then a blank
screen, then a smiley again -- it never stops! (That's because of the
``forever`` block.)
@@ -69,7 +70,7 @@ Click **Compile** to move your program to the BBC micro:bit!
### Your turn!
Pile up more ``show leds`` blocks to create your animation! Create an
Pile up more ``show leds`` blocks to create an animation! Create an
animation with at least 5 pictures. What does this animation show?
```blocks
@@ -496,7 +497,7 @@ input.onButtonPressed(Button.B, () => {
```
Click **Compile** to move your program to the BBC micro:bit!
## Your turn!
How else can you make your game better?
Ever hear of [Rock Paper Scissors Spock Lizard](http://www.samkass.com/theories/RPSSL.html)?
# Want to do more?
There are [10 great projects](/projects) waiting for you.

View File

@@ -1,4 +1,4 @@
# Micro:bit APIs
# Reference
```namespaces
basic.showNumber(0);

View File

@@ -6,9 +6,9 @@ Turn off all the LED lights on the [LED screen](/device/screen).
basic.clearScreen()
```
### Example: vanishing heart
### Example: Vanishing heart
The following code shows a heart on the screen and then turns off all the LED lights using `clear screen`:
The following code shows a heart on the screen and then turns off all the LED lights.
```blocks
basic.showLeds(`
@@ -23,5 +23,5 @@ basic.clearScreen()
### See also
[set brightness](/reference/led/set-brightness), [unplot](/reference/led/unplot), [plot](/reference/led/plot), [Image](/reference/images/image), [clear](/reference/basic/clear-screen)
[set brightness](/reference/led/set-brightness), [unplot](/reference/led/unplot), [plot](/reference/led/plot), [Image](/reference/images/image)

View File

@@ -1,11 +1,11 @@
# Send Number
# Send Value
Broadcast a (name,number) pair to other micro:bits connected via ``radio``.
Send a [string]() and [number]() together by ``radio`` to other micro:bits.
### Parameters
* name - a string to send
* num - a number to send.
* a [string](/reference/types/string) to send by radio
* a [number](/reference/types/number) to send by radio
### Simulator
@@ -13,16 +13,29 @@ This function only works on the micro:bit, not in browsers.
### Example: Broadcasting acceleration
This example broadcasts the value of your micro:bit's ``acceleration`` in the `x` direction
(left and right) to other micro:bits.
This kind of program might be useful in a model car or model rocket.
This program sends your micro:bit's **acceleration** (amount it is
speeding up or slowing down) in the `x` direction (left and right) to
other micro:bits. This kind of program might be useful in a model car
or model rocket.
```blocks
radio.setGroup(99)
input.onButtonPressed(Button.A, () => {
radio.sendValue("acc",input.acceleration(Dimension.X))
})
```
This program receives the string and number sent by the last program.
Then it shows them on the LED screen.
```blocks
radio.setGroup(99)
radio.onDataReceived(() => {
basic.showString(radio.receiveString());
basic.showNumber(radio.receiveNumber());
});
```
### See also
[receive number](/reference/radio/receive-number), [on data received](/reference/radio/on-data-received)

View File

@@ -1,6 +1,6 @@
{
"name": "pxt-microbit",
"version": "0.2.166",
"version": "0.2.170",
"description": "BBC micro:bit target for PXT",
"keywords": [
"JavaScript",
@@ -29,6 +29,6 @@
"typescript": "^1.8.7"
},
"dependencies": {
"pxt-core": "0.2.179"
"pxt-core": "0.2.182"
}
}