Compare commits

...

13 Commits

Author SHA1 Message Date
98bc8d2a27 0.3.56 2016-08-31 15:20:34 -07:00
58d0e238e3 Bump pxt-core to 0.3.65 2016-08-31 15:20:33 -07:00
60f8dd8228 annotating note with TD_ID 2016-08-31 11:22:07 -07:00
a34bcee7a2 added simulator 2016-08-30 13:39:31 -07:00
d011cdb37e updated cli / vscode docs 2016-08-30 13:34:05 -07:00
b37e823b57 0.3.55 2016-08-30 11:35:31 -07:00
8cb31daa48 Adding CLI pointer 2016-08-30 11:35:16 -07:00
e856d59235 0.3.54 2016-08-30 12:50:18 +02:00
32753d3395 Bump pxt-core to 0.3.61 2016-08-30 12:50:18 +02:00
7b11a04727 Upgrade pxt-microbit-core to 0.4.1 2016-08-30 12:48:58 +02:00
6d6c053e4f 0.3.53 2016-08-29 23:25:12 -07:00
1008fdd371 Bump pxt-core to 0.3.60 2016-08-29 23:25:11 -07:00
ddc2b7437b re-ordering of blocks in docs 2016-08-29 14:49:51 -07:00
9 changed files with 78 additions and 53 deletions

17
docs/cli.md Normal file
View File

@ -0,0 +1,17 @@
# Command Line Interface
```sim
basic.forever(() => {
basic.showString("CLI<3")
})
```
It is possible to use the codethemicrobit tools from a command line interface (CLI). The PXT CLI allows to
* edit, compile or deploy JavaScript programs
* can easily be integrated in most IDEs. It comes with built-in support for [Visual Studio Code](/code)!
* run a local web server for the web editor
* author packages using JavaScript and/or C++
Using the CLI assumes that you have some experience with programming and will require to install tools on your machine as well.
* **[LET'S GET STARTED](https://pxt.io/cli)**

View File

@ -1,54 +1,16 @@
# Visual Studio Code
Visual Studio Code is a Free Open Source code editor that you can use to edit your programs.
[Visual Studio Code](https://code.visualstudio.com) is a Free Open Source code editor that you can use to edit your programs.
Working from Visual Studio code allows you to benefit from all the features
of a professional IDE while working with PXT: working with files,
git integration (or source control of your choice), hundreds of extensions.
![](https://code.visualstudio.com/home/home-screenshot-win-lg.png)
* background compilation
* auto-completion
* pxt command line integration
## Setup
**Follow [these instructions](https://pxt.io/cli)** to setup your machine and edit your programs in Visual Studio Code.
Follow these instructions to setup your machine and edit your programs in Visual Studio Code.
![](/static/mb/vscode.png)
* install [Visual Studio Code](https://code.visualstudio.com/)
* install [Node.JS](https://nodejs.org/en/)
* install the PXT Tools (on Mac or Linux, you might have to add ``sudo`` to the command).
```
pxt install -g pxt
```
* create a folder for your projects
```
mkdir microbit
```
* install the microbit target
```
pxt target microbit
```
That's it! You are ready to create new projects in code or open existing projects.
## Creating a new project
Open a shell to your ``microbit`` folder.
```
# create a new subfolder for your project
mkdir myproject
cd myproject
# start the project set
pxt init
# open code
code .
```
## Opening an existing project
You can extract a project from the embedded URL or .hex file. Open a shell to your projects folder
```
# extract the project from the URL
pxt extract EMBEDURL
```
where ``EMBEDURL`` is the published project URL.

View File

@ -26,4 +26,5 @@
### Developers
* [Command Line Interface](/cli)
* Learn about [packages](/packages)

View File

@ -6,6 +6,7 @@ Control of the LED screen.
led.plot(0, 0);
led.unplot(0, 0);
led.point(0, 0);
led.toggle(0, 0);
led.brightness();
led.setBrightness(255);
led.stopAnimation();
@ -14,7 +15,6 @@ led.fadeIn();
led.fadeOut();
led.plotAll();
led.screenshot();
led.toggle(0, 0);
led.toggleAll();
led.setDisplayMode(DisplayMode.BackAndWhite);
```

BIN
docs/static/mb/vscode.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@ -196,6 +196,8 @@ namespace pxt {
int programHash();
//%
void *ptrOfLiteral(int offset);
//%
int getNumGlobals();
}
namespace pxtrt {
@ -308,11 +310,6 @@ namespace pxtrt {
// Debugger
//
//%
uint32_t getNumGlobals() {
return numGlobals;
}
//%
void* getGlobalsPtr() {
return globals;

View File

@ -1,63 +1,110 @@
enum Note {
C = 262,
//% block=C#
//% blockIdentity=music.noteFrequency
CSharp = 277,
//% blockIdentity=music.noteFrequency
D = 294,
//% blockIdentity=music.noteFrequency
Eb = 311,
//% blockIdentity=music.noteFrequency
E = 330,
//% blockIdentity=music.noteFrequency
F = 349,
//% block=F#
//% blockIdentity=music.noteFrequency
FSharp = 370,
//% blockIdentity=music.noteFrequency
G = 392,
//% block=G#
//% blockIdentity=music.noteFrequency
GSharp = 415,
//% blockIdentity=music.noteFrequency
A = 440,
//% blockIdentity=music.noteFrequency
Bb = 466,
//% blockIdentity=music.noteFrequency
B = 494,
//% blockIdentity=music.noteFrequency
C3 = 131,
//% block=C#3
//% blockIdentity=music.noteFrequency
CSharp3 = 139,
//% blockIdentity=music.noteFrequency
D3 = 147,
//% blockIdentity=music.noteFrequency
Eb3 = 156,
//% blockIdentity=music.noteFrequency
E3 = 165,
//% blockIdentity=music.noteFrequency
F3 = 175,
//% block=F#3
//% blockIdentity=music.noteFrequency
FSharp3 = 185,
//% blockIdentity=music.noteFrequency
G3 = 196,
//% block=G#3
//% blockIdentity=music.noteFrequency
GSharp3 = 208,
//% blockIdentity=music.noteFrequency
A3 = 220,
//% blockIdentity=music.noteFrequency
Bb3 = 233,
//% blockIdentity=music.noteFrequency
B3 = 247,
//% blockIdentity=music.noteFrequency
C4 = 262,
//% block=C#4
//% blockIdentity=music.noteFrequency
CSharp4 = 277,
//% blockIdentity=music.noteFrequency
D4 = 294,
//% blockIdentity=music.noteFrequency
Eb4 = 311,
//% blockIdentity=music.noteFrequency
E4 = 330,
//% blockIdentity=music.noteFrequency
F4 = 349,
//% block=F#4
//% blockIdentity=music.noteFrequency
FSharp4 = 370,
//% blockIdentity=music.noteFrequency
G4 = 392,
//% block=G#4
//% blockIdentity=music.noteFrequency
GSharp4 = 415,
//% blockIdentity=music.noteFrequency
A4 = 440,
//% blockIdentity=music.noteFrequency
Bb4 = 466,
//% blockIdentity=music.noteFrequency
B4 = 494,
//% blockIdentity=music.noteFrequency
C5 = 523,
//% block=C#5
//% blockIdentity=music.noteFrequency
CSharp5 = 555,
//% blockIdentity=music.noteFrequency
D5 = 587,
//% blockIdentity=music.noteFrequency
Eb5 = 622,
//% blockIdentity=music.noteFrequency
E5 = 659,
//% blockIdentity=music.noteFrequency
F5 = 698,
//% block=F#5
//% blockIdentity=music.noteFrequency
FSharp5 = 740,
//% blockIdentity=music.noteFrequency
G5 = 784,
//% block=G#5
//% blockIdentity=music.noteFrequency
GSharp5 = 831,
//% blockIdentity=music.noteFrequency
A5 = 880,
//% blockIdentity=music.noteFrequency
Bb5 = 932,
//% blockIdentity=music.noteFrequency
B5 = 989,
}
@ -121,6 +168,7 @@ namespace music {
*/
//% weight=50 help=music/note-frequency
//% blockId=device_note block="%note"
//% shim=TD_ID
export function noteFrequency(name: Note): number {
return name;
}

View File

@ -1,6 +1,6 @@
{
"name": "pxt-microbit",
"version": "0.3.52",
"version": "0.3.56",
"description": "micro:bit target for PXT",
"keywords": [
"JavaScript",
@ -29,6 +29,6 @@
"typescript": "^1.8.7"
},
"dependencies": {
"pxt-core": "0.3.59"
"pxt-core": "0.3.65"
}
}

View File

@ -81,7 +81,7 @@
"yottaTarget": "bbc-microbit-classic-gcc",
"yottaCorePackage": "pxt-microbit-core",
"githubCorePackage": "microsoft/pxt-microbit-core",
"gittag": "v0.3.1",
"gittag": "v0.4.1",
"serviceId": "ws"
},
"serial": {