Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
98bc8d2a27 | |||
58d0e238e3 | |||
60f8dd8228 | |||
a34bcee7a2 | |||
d011cdb37e | |||
b37e823b57 | |||
8cb31daa48 | |||
e856d59235 | |||
32753d3395 | |||
7b11a04727 | |||
6d6c053e4f | |||
1008fdd371 | |||
ddc2b7437b |
17
docs/cli.md
Normal file
17
docs/cli.md
Normal 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)**
|
50
docs/code.md
50
docs/code.md
@ -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.
|
||||
|
||||

|
||||
* 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.
|
||||

|
||||
|
||||
* 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.
|
@ -26,4 +26,5 @@
|
||||
|
||||
### Developers
|
||||
|
||||
* [Command Line Interface](/cli)
|
||||
* Learn about [packages](/packages)
|
||||
|
@ -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
BIN
docs/static/mb/vscode.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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": {
|
||||
|
Reference in New Issue
Block a user