Compare commits

...

12 Commits

Author SHA1 Message Date
Peli de Halleux
539357237f 0.2.124 2016-05-19 12:37:54 -07:00
Peli de Halleux
35d59da17e Bump pxt-core to 0.2.130 2016-05-19 12:37:52 -07:00
Peli de Halleux
0b226bc9aa updated category colors theme 2016-05-19 11:59:57 -07:00
Peli de Halleux
f2bab5d122 missing async annotation on serial 2016-05-19 10:53:48 -07:00
Peli de Halleux
6e6a98559c updated setup instructions 2016-05-19 10:34:24 -07:00
Ron Hale-Evans
217fce953d Table of contents proof of concept 2016-05-18 15:57:43 -07:00
Peli de Halleux
bfac2910da tentative serial fix for #66 2016-05-18 11:57:10 -07:00
Peli de Halleux
5962c28b0e Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2016-05-18 11:30:38 -07:00
Ron Hale-Evans
d3509a6254 Test docs tweak 2016-05-18 11:28:15 -07:00
Peli de Halleux
df91bf234c adding side menu 2016-05-18 11:15:00 -07:00
Peli de Halleux
2a46935f62 better startup instructions 2016-05-18 09:18:14 -07:00
Peli de Halleux
5e024c6f23 added test package 2016-05-17 10:42:44 -07:00
18 changed files with 279 additions and 53 deletions

View File

@@ -7,21 +7,39 @@ This target allow to program a [BBC micro:bit](https://www.microbit.co.uk/) usin
[![Build Status](https://travis-ci.org/Microsoft/pxt-microbit.svg?branch=master)](https://travis-ci.org/Microsoft/pxt-microbit)
# Getting started
## Local server
Please follow instructions at https://github.com/Microsoft/pxt#running-a-target-from-localhost
### Setup
The following commands are a 1-time setup after synching the repo on your machine.
* install the PXT command line
```
npm install -g pxt
```
* install the dependencies
```
npm install
```
### Running
Run this command to open a local web server:
```
pxt serve
```
To make sure you're running the latest tools, run
```
npm update
```
More instructions at https://github.com/Microsoft/pxt#running-a-target-from-localhost
## Universal Windows App
The Windows 10 app is a [Universal Windows Hosted Web App](https://microsoftedge.github.io/WebAppsDocs/en-US/win10/CreateHWA.htm)
that wraps m.pxt.io and provides additional features.
### Sideloading
* Open Windows **settings** and search for **Developer options**
* Enable the developer mode.
* Find the latest build under ``win10/app/AppPackages/latest`` and run the ``Add-AppDevPackage.ps1`` PowerShell script (mouse right-click, then `run with PowerShell`)
### Building
* Install Visual Studio 2015 Update 2 or higher. Make sure the Windows 10 templates are installed.

View File

@@ -26,7 +26,7 @@ input.onButtonPressed(Button.B, () => {
The [BBC micro:bit](https://www.microbit.co.uk) is a [pocket-size computer](/device) with a 5x5 display of 25 LEDs, Bluetooth and sensors that can be programmed by anyone.
The BBC micro:bit was made possible by many [partners](https://www.microbit.co.uk/partners).
The micro:bit provides a fun introduction to programming and making switch on, program it to do something fun wear it, customize it.
The micro:bit provides an easy and fun introduction to programming and making switch on, program it to do something fun wear it, customize it.
Just like Arduino, the micro:bit can be connected to and interact with sensors, displays, and other devices.
## Blocks or JavaScript

197
docs/reference/toc.md Normal file
View File

@@ -0,0 +1,197 @@
acceleration
analog-pitch
analog-read-pin
analog-set-period
analog-set-pitch-pin
analog-write-pin
assign
boolean
brightness
button-is-pressed
change
change-score-by
change-tempo
change-var
clear
clear-screen
compass-heading
create-image
digital-read-pin
digital-write-pin
fade-in
fade-out
for
forever
game-library
game-over
if
image
in-background
light-level
magnetic-force
map
math
move
number
[on button pressed](/reference/input/on-button-pressed)
on-data-received
on-gamepad-button
on-gesture
on-pin-pressed
on-signal-strength-changed
pause
pin-is-pressed
pixel
play-tone
plot
plot-all
plot-bar-graph
plot-frame
plot-image
plot-leds
point
position
raise-alert-to
receive-number
receive-number
repeat
reports
reset
rest
ring-tone
rotation
running-time
score
screenshot
scroll-image
send-number
servo-set-pulse
servo-write-pin
set-brightness
set-display-mode
set-group
set-pixel
set-tempo
show-animation
show-frame
show-image
show-leds
show-number
show-string
signal-strength
start-countdown
stop-animation
string
tell-camera-to
tell-microphone-to
tell-remote-control-to
temperature
tempo
toggle
toggle-all
touching
turn
unplot
var
while
width
write-line
write-value

View File

@@ -1,6 +1,6 @@
/**
* Communicate data using radio packets
*/
//% color=270 weight=34
//% color=#E3008C weight=34
namespace radio {
}

View File

@@ -4,7 +4,7 @@
/**
* Provides access to basic micro:bit functionality.
*/
//% color=190 weight=100
//% color=#0078D7 weight=100
namespace basic {
/**

View File

@@ -21,18 +21,18 @@ enum LedSpriteProperty {
/**
* A single-LED sprite game engine
*/
//% color=176 weight=32
//% color=#008272 weight=32
namespace game {
var _score: number = 0;
var _life: number = 3;
var _startTime: number = 0;
var _endTime: number = 0;
var _isGameOver: boolean = false;
var _countdownPause: number = 0;
var _level: number = 1;
var _gameId: number = 0;
var img: Image;
var sprites: LedSprite[];
let _score: number = 0;
let _life: number = 3;
let _startTime: number = 0;
let _endTime: number = 0;
let _isGameOver: boolean = false;
let _countdownPause: number = 0;
let _level: number = 1;
let _gameId: number = 0;
let img: Image;
let sprites: LedSprite[];
/**
* Creates a new LED sprite pointing to the right.

View File

@@ -3,7 +3,7 @@
/**
* Creation, manipulation and display of LED images.
*/
//% color=45 weight=31
//% color=#5C2D91 weight=31
namespace images {
/**
* Creates an image that fits on the LED screen.

View File

@@ -1,7 +1,7 @@
/**
* Events and data from sensors
*/
//% color=300 weight=99
//% color=#B4009E weight=99
namespace input {
/**
* Attaches code to run when the screen is facing up.

View File

@@ -1,7 +1,7 @@
/**
* Control of the LED screen.
*/
//% color=3 weight=35
//% color=#5C2D91 weight=35
namespace led {
// what's the current high value

View File

@@ -77,7 +77,7 @@ enum BeatFraction {
/**
* Generation of music tones through pin ``P0``.
*/
//% color=52 weight=98
//% color=#D83B01 weight=98
namespace music {
let beatsPerMinute: number = 120;

View File

@@ -1,7 +1,7 @@
/**
* Control currents in Pins for analog/digital signals, servos, i2c, ...
*/
//% color=351 weight=30
//% color=#A80000 weight=30
namespace pins {
/**
* Re-maps a number from one range to another. That is, a value of ``from low`` would get mapped to ``to low``, a value of ``from high`` to ``to high``, values in-between to values in-between, etc.

View File

@@ -1,7 +1,7 @@
/**
* Reading and writing data over a serial connection.
*/
//% weight=2 color=30
//% weight=2 color=#002050
namespace serial {
/**
* Prints a line of text to the serial
@@ -11,8 +11,7 @@ namespace serial {
//% help=serial/write-line blockGap=8
//% blockId=serial_writeline block="serial|write line %text"
export function writeLine(text: string): void {
writeString(text);
writeString("\r\n");
writeString(text + "\r\n");
}
/**
@@ -34,10 +33,7 @@ namespace serial {
//% help=serial/write-value
//% blockId=serial_writevalue block="serial|write value %name|= %value"
export function writeValue(name: string, value: number): void {
writeString(name);
writeString(":");
writeNumber(value);
writeLine("");
writeString(name + ":" + value + "\r\n");
}
/**

View File

@@ -4,7 +4,7 @@
/**
* Creation, manipulation and display of LED images.
*/
//% color=45 weight=31
//% color=#5C2D91 weight=31
declare namespace images {
/**
@@ -113,7 +113,7 @@ declare interface Image {
/**
* Provides access to basic micro:bit functionality.
*/
//% color=190 weight=100
//% color=#0078D7 weight=100
declare namespace basic {
/**

View File

@@ -0,0 +1 @@
run ``pxt testdir ../../buit/docs/blocks`` from this folder

View File

View File

@@ -0,0 +1,13 @@
{
"name": "test-snippets",
"description": "A test project for doc snippets",
"installedVersion": "file:.",
"files": [
"main.ts"
],
"public": true,
"dependencies": {
"microbit": "file:../microbit",
"microbit-radio": "file:../microbit-radio"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "pxt-microbit",
"version": "0.2.123",
"version": "0.2.124",
"description": "BBC micro:bit target for PXT",
"keywords": [
"JavaScript",
@@ -29,6 +29,6 @@
"typescript": "^1.8.7"
},
"dependencies": {
"pxt-core": "0.2.129"
"pxt-core": "0.2.130"
}
}

View File

@@ -72,7 +72,7 @@
"log": true
},
"appTheme": {
"accentColor": "#5C2D91",
"accentColor": "#5C005C",
"logoUrl": "https://m.pxt.io/about",
"logo": "./static/microbit.simplified.svg",
"docsLogo": "./static/microbit.simplified.svg",
@@ -102,6 +102,7 @@
"name": "Device",
"path": "/device"
}
]
],
"sideDoc": "getting-started"
}
}