Compare commits
41 Commits
Author | SHA1 | Date | |
---|---|---|---|
31998fec05 | |||
342aa3ca32 | |||
9b599b6242 | |||
e5e63c548f | |||
f3eb9a988f | |||
e7e2ff7752 | |||
f10ac93268 | |||
47f46553e0 | |||
3158e95cde | |||
854029fe33 | |||
1b379bddd0 | |||
9495da9a53 | |||
128b3f2f51 | |||
a331a017b8 | |||
790b9f557a | |||
0b469f69b6 | |||
5cce86ec7e | |||
65e01dc0df | |||
1a3c31c9f3 | |||
7aeb216462 | |||
543659b0e8 | |||
a2b5ff68af | |||
b968d3b1de | |||
4dbebe3e15 | |||
3b95fede48 | |||
5d4bd77bf4 | |||
c83d7e9f07 | |||
971faed80a | |||
02a58caf7a | |||
912e2e6159 | |||
efee05c7f5 | |||
cc9ab86181 | |||
ef8d7185ee | |||
b0392da8b1 | |||
c817f9e3ff | |||
5f78f98f94 | |||
395b6184b9 | |||
3274964a11 | |||
f5e8b35df4 | |||
996073728c | |||
1e964ba1ea |
4
.gitignore
vendored
@ -24,3 +24,7 @@ clients/electron/projects
|
||||
*.db
|
||||
*.suo
|
||||
*.log
|
||||
|
||||
.DS_Store
|
||||
.idea
|
||||
*.iml
|
||||
|
22
cmds/cmds.ts
@ -13,20 +13,20 @@ export function deployCoreAsync(res: ts.pxtc.CompileResult) {
|
||||
return getBitDrivesAsync()
|
||||
.then(drives => {
|
||||
if (drives.length == 0) {
|
||||
let msg = "cannot find any drives to deploy to";
|
||||
console.log(msg);
|
||||
return Promise.reject(new Error(msg));
|
||||
console.log("cannot find any drives to deploy to");
|
||||
return Promise.resolve(0);
|
||||
}
|
||||
|
||||
console.log(`copy ${ts.pxtc.BINARY_HEX} to ` + drives.join(", "))
|
||||
console.log(`copy ${ts.pxtc.BINARY_HEX} to ` + drives.join(", "));
|
||||
|
||||
return Promise.map(drives, d =>
|
||||
writeFileAsync(d + ts.pxtc.BINARY_HEX, res.outfiles[ts.pxtc.BINARY_HEX])
|
||||
.then(() => {
|
||||
console.log("wrote hex file to " + d)
|
||||
}))
|
||||
})
|
||||
.then(() => { })
|
||||
let writeHexFile = (filename: string) => {
|
||||
return writeFileAsync(filename + ts.pxtc.BINARY_HEX, res.outfiles[ts.pxtc.BINARY_HEX])
|
||||
.then(() => console.log("wrote hex file to " + filename));
|
||||
};
|
||||
|
||||
return Promise.map(drives, d => writeHexFile(d))
|
||||
.then(() => drives.length);
|
||||
});
|
||||
}
|
||||
|
||||
function getBitDrivesAsync(): Promise<string[]> {
|
||||
|
@ -1,11 +1,40 @@
|
||||
# crocodile clips
|
||||
|
||||
The large holes at the bottom of the board are designed to attach alligator/crocodile clips.
|
||||
Register an event that will execute whenever the user attaches one side of the crocodile clip to the `GND` pin, then connects and disconnects the unattached side of the crocodile clip to pin `0`, `1`, or `2`.
|
||||
The large holes at the bottom of the board are designed to attach alligator/crocodile clips
|
||||
to create electrical circuit with other components.
|
||||
|
||||
### Example: on pin pressed with random numbers
|
||||
# ~hint
|
||||
|
||||
This example displays a random number every time the crocodile clip holds `GND` then connects and disconnects the `P0` pin. Each time the crocodile clip is firmly connected and disconnected from pin `P0`, the micro:bit will return a random Number between 0 and the parameter limit
|
||||
**No crocodile clips!?!?!** Use wires or Aluminium foil! [Read more...](/device/foil-circuits)
|
||||
|
||||
# ~
|
||||
|
||||
|
||||
## Connecting Crocodile Clips
|
||||
|
||||
The hole for ``P0`` and ``GND`` allow to grab the board on the side which makes for a great grip.
|
||||
|
||||

|
||||
|
||||
Pass one jaw in the hole and grab the side of the board with the other jaw.
|
||||
|
||||

|
||||
|
||||
For the center holes, ``P1`` and ``P2``, you can also grab the bottom of the board but they are a bit harder to grip.
|
||||
|
||||
You can also grip the board between the jaws. In which case, you will want to make sure to avoid overlapping the jaws
|
||||
with the other pins as it will create short-circuit in the board.
|
||||
|
||||

|
||||
|
||||
Adding a little tape helps keeping the crocodile clips in place.
|
||||
|
||||

|
||||
|
||||
## Example: on pin pressed with random numbers
|
||||
|
||||
This example displays a random number every time the crocodile clip holds `GND` then connects and disconnects the `P0` pin.
|
||||
Each time the crocodile clip is firmly connected and disconnected from pin `P0`, the micro:bit will return a random Number between 0 and the parameter limit.
|
||||
|
||||
```blocks
|
||||
input.onPinPressed(TouchPin.P0, () => {
|
||||
@ -13,11 +42,6 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
})
|
||||
```
|
||||
|
||||
### Connecting Crocodile Clips
|
||||
|
||||

|
||||
|
||||
### See also
|
||||
|
||||
[micro:bit pins](/device/pins), [pin is pressed](/reference/input/pin-is-pressed), [analog read pin](/reference/pins/analog-read-pin), [analog write pin](/reference/pins/analog-write-pin), [digital read pin](/reference/pins/digital-read-pin), [digital write pin](/reference/pins/digital-write-pin)
|
||||
## See also
|
||||
|
||||
[micro:bit pins](/device/pins)
|
||||
|
@ -1,7 +1,5 @@
|
||||
# Error codes
|
||||
|
||||
The micro:bit error codes
|
||||
|
||||
Your micro:bit may encounter a situation that prevents it from running your code. When this happens, a frowny face will appear on your micro:bit screen (see picture) followed by an error number.
|
||||
|
||||
Below is a list of error numbers and what they mean:
|
||||
|
52
docs/device/foil-circuits.md
Normal file
@ -0,0 +1,52 @@
|
||||
# foil circuits
|
||||
|
||||
The large holes at the bottom of the board are designed to attach alligator/crocodile clips
|
||||
to create electrical circuit with other components.
|
||||
|
||||
If you do not have crocodile clips at hand, dyou can use wires or even Aluminium foil to acheive the same result.
|
||||
We will show you how to connect the micro:bit to headphones using Alumunium foil and tape.
|
||||
|
||||
https://youtu.be/mhXYyPuvpz0
|
||||
|
||||
### Materials
|
||||
|
||||
* micro:bit and battery pack (you can also power it via USB)
|
||||
* a small piece of cardboard
|
||||
* Aluminium foil
|
||||
* tape
|
||||
|
||||
### Assembly instructions
|
||||
|
||||
Tape the micro:bit and battery pack to the card board. Make sure to remove the batteries while you are building your circuit.
|
||||
|
||||

|
||||
|
||||
Cut the thinest strip of foil possible and roll it into a cable. You can also try to fold, whatever works for you.
|
||||
Build two of those wires.
|
||||
|
||||

|
||||
|
||||
Place the foil wire on the ``GND`` pin and attach with a piece of tape. Press hard to get the best connection between
|
||||
the foil and the pin board. Make sure the foil is not overlapping with the other pins!
|
||||
|
||||

|
||||
|
||||
Place the second wire on the ``P0`` pin the same way. Make sure the wire does not overlap with the other pins!
|
||||
|
||||

|
||||
|
||||
Tape the headphone jack connector to the cardboard and roll the wire coming from ``GND`` around the metal base.
|
||||
Make sure the wire does not touch the other metal rings on the jack.
|
||||
|
||||

|
||||
|
||||
Tape the second wire on the head of the jack connector.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
## See also
|
||||
|
||||
[micro:bit pins](/device/pins)
|
@ -7,11 +7,12 @@
|
||||
```sim
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
);
|
||||
basic.pause(500);
|
||||
basic.clearScreen();
|
||||
basic.pause(500);
|
||||
@ -29,11 +30,12 @@ Use [show leds](/reference/basic/show-leds) and make your code look like this:
|
||||
|
||||
```blocks
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
);
|
||||
```
|
||||
|
||||
## Step 2
|
||||
@ -42,11 +44,11 @@ Add a [pause](/reference/basic/pause) to wait and [clear screen](/reference/basi
|
||||
|
||||
```blocks
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
basic.pause(500);
|
||||
basic.clearScreen();
|
||||
```
|
||||
@ -58,11 +60,12 @@ Put a [forever loop](/reference/basic/forever) around it.
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
);
|
||||
basic.pause(500);
|
||||
basic.clearScreen();
|
||||
})
|
||||
@ -75,11 +78,12 @@ Add a [pause](/reference/basic/pause) to wait after clearing the screen.
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
);
|
||||
basic.pause(500);
|
||||
basic.clearScreen();
|
||||
basic.pause(500);
|
||||
@ -94,20 +98,22 @@ Add a second image of a broken heart.
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
);
|
||||
basic.pause(500);
|
||||
basic.clearScreen();
|
||||
basic.pause(500);
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# . # # #
|
||||
# . . . #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
. # . # .
|
||||
# . # # #
|
||||
# . . . #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
);
|
||||
basic.pause(500);
|
||||
basic.clearScreen();
|
||||
basic.pause(500);
|
||||
|
@ -24,6 +24,12 @@ Build your own music player micro:bit from headphones.
|
||||
* [Connect your headphone](/projects/hack-your-headphone/making)
|
||||
* [Play sounds!]()
|
||||
|
||||
# ~hint
|
||||
|
||||
**No crocodile clips!?!?!** Use wires or Aluminium foil! [Read more...](/device/foil-circuits)
|
||||
|
||||
# ~
|
||||
|
||||
### ~button /projects/hack-your-headphones/making
|
||||
|
||||
Let's get started!
|
||||
|
@ -6,6 +6,12 @@ Did you know you could attach your headhpones to the micro:bit to generate sound
|
||||
|
||||
### ~
|
||||
|
||||
# ~hint
|
||||
|
||||
**No crocodile clips!?!?!** Use wires or Aluminium foil! [Read more...](/device/foil-circuits)
|
||||
|
||||
# ~
|
||||
|
||||
### Step 1
|
||||
|
||||

|
||||
|
@ -10,11 +10,12 @@ Use [show leds](/reference/basic/show-leds) to make a smiley face:
|
||||
|
||||
```blocks
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .`);
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .`
|
||||
);
|
||||
```
|
||||
|
||||
## Step 2
|
||||
@ -24,18 +25,20 @@ frowny face inside it:
|
||||
|
||||
```blocks
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .`);
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
. # # # .
|
||||
# . . . #`);
|
||||
# . . . #
|
||||
. # # # .`
|
||||
);
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
. # # # .
|
||||
# . . . #`
|
||||
);
|
||||
});
|
||||
```
|
||||
|
||||
@ -45,25 +48,28 @@ Now add blocks so that when [button B is pressed](/reference/input/button-is-pre
|
||||
|
||||
```blocks
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .`);
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
. # # # .
|
||||
# . . . #`);
|
||||
});
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .`);
|
||||
. # # # .`
|
||||
);
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
. # # # .
|
||||
# . . . #`
|
||||
);
|
||||
});
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .`
|
||||
);
|
||||
});
|
||||
```
|
||||
|
140
docs/static/Calliopeminieditor.svg
vendored
@ -1,125 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="calliope"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 179.9 32.4"
|
||||
enable-background="new 0 0 179.9 32.4"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="Calliopeminieditor.svg"><metadata
|
||||
id="metadata65"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs63" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1536"
|
||||
inkscape:window-height="801"
|
||||
id="namedview61"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1.6008894"
|
||||
inkscape:cx="89.949997"
|
||||
inkscape:cy="16.200001"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="calliope" /><g
|
||||
id="g3"><g
|
||||
id="g5"><path
|
||||
fill="#495260"
|
||||
d="M33.1,11.2h-8.5V5.8c0-2.3,1.9-4.2,4.2-4.2h0c2.3,0,4.2,1.9,4.2,4.2V11.2z"
|
||||
id="path7" /><rect
|
||||
x="25.8"
|
||||
y="3.6"
|
||||
fill="#7F96A1"
|
||||
width="6.2"
|
||||
height="7.6"
|
||||
id="rect9" /><path
|
||||
fill="#845B32"
|
||||
d="M12.2,7.2c0,0.8,0,10.8,0,10.8h12.5c0,0,0-10.1,0-10.8c0-3.4-2.8-6.2-6.2-6.2S12.2,3.8,12.2,7.2z"
|
||||
id="path11" /><path
|
||||
fill="#26A7AA"
|
||||
d="M28.9,31.4H8.7c-6.3,0-9-8-4-11.8L16,11.2h17.1v16C33.1,29.5,31.2,31.4,28.9,31.4z"
|
||||
id="path13" /><polygon
|
||||
fill="#43C9C9"
|
||||
points="15.2,17.7 6.4,18.4 17.1,10.4 "
|
||||
id="polygon15" /><polygon
|
||||
fill="#F6F4E7"
|
||||
points="14.8,15.1 17.1,10.4 18.6,15.1 "
|
||||
id="polygon17" /><polygon
|
||||
fill="#F6F4E7"
|
||||
points="18.6,15.1 20,10.4 22.3,15.1 "
|
||||
id="polygon19" /><polygon
|
||||
fill="#BDD1CF"
|
||||
points="21.9,17.7 15.2,17.7 14.8,15.1 22.3,15.1 "
|
||||
id="polygon21" /><path
|
||||
fill="#F6F4E7"
|
||||
d="M26.8,31.4c-0.6-4.6-1.9-10.2-4.8-13.7h0v0h-3.4h-3.4v0h0c-3,3.5-4.2,9.1-4.8,13.7H26.8z"
|
||||
id="path23" /><path
|
||||
fill="#FFCD9A"
|
||||
d="M18.6,10.5L18.6,10.5c-1.4,0-2.6-1.2-2.6-2.6V5h5.1v2.9C21.1,9.4,20,10.5,18.6,10.5z"
|
||||
id="path25" /><path
|
||||
fill="#BDD1CF"
|
||||
d="M15.4,31.4l0-13.7c2.2,5.1,4.9,11.3,8.2,13.7H15.4z"
|
||||
id="path27" /><polygon
|
||||
fill="#FFCD9A"
|
||||
points="17.1,10.4 18.6,15.1 20,10.4 "
|
||||
id="polygon29" /><polygon
|
||||
fill="#43C9C9"
|
||||
points="25.8,11.2 33.1,11.2 33.1,20.6 "
|
||||
id="polygon31" /></g><g
|
||||
id="g33"><g
|
||||
id="g35"><path
|
||||
fill="#BCD1CF"
|
||||
d="M52.3,15.1h-1.6l-0.2-1.4c-0.2-0.2-0.5-0.4-0.8-0.5S49,13,48.5,13c-0.9,0-1.7,0.3-2.2,1s-0.8,1.6-0.8,2.7 v0.4c0,1.1,0.3,2,0.8,2.7c0.5,0.7,1.2,1,2.1,1c0.4,0,0.8-0.1,1.2-0.2c0.4-0.1,0.6-0.3,0.8-0.5l0.2-1.4h1.6v2.1 c-0.4,0.5-1,0.9-1.7,1.2c-0.7,0.3-1.4,0.5-2.3,0.5c-1.5,0-2.6-0.5-3.6-1.5s-1.4-2.3-1.4-3.9v-0.4c0-1.6,0.5-2.9,1.4-3.9 s2.1-1.5,3.6-1.5c0.8,0,1.6,0.2,2.3,0.5c0.7,0.3,1.2,0.7,1.7,1.2V15.1z"
|
||||
id="path37" /><path
|
||||
fill="#BCD1CF"
|
||||
d="M53.8,21l0.8-0.1l3.3-9.4h2.2l3.3,9.4l0.8,0.1v1.3h-3.7V21l0.8-0.1l-0.5-1.5h-3.5l-0.5,1.5l0.8,0.1v1.3 h-3.7V21z M57.7,17.8h2.5L59,14h0L57.7,17.8z"
|
||||
id="path39" /><path
|
||||
fill="#BCD1CF"
|
||||
d="M65.5,22.3V21l1.2-0.2V13l-1.2-0.2v-1.3h1.2h2.2H70v1.3L68.8,13v7.6h3.1l0.1-1.4h1.7v3H65.5z"
|
||||
id="path41" /><path
|
||||
fill="#BCD1CF"
|
||||
d="M75,22.3V21l1.2-0.2V13L75,12.8v-1.3h1.2h2.2h1.2v1.3L78.3,13v7.6h3.1l0.1-1.4h1.7v3H75z"
|
||||
id="path43" /><path
|
||||
fill="#BCD1CF"
|
||||
d="M84.5,12.8v-1.3H89v1.3L87.9,13v7.8L89,21v1.3h-4.5V21l1.2-0.2V13L84.5,12.8z"
|
||||
id="path45" /><path
|
||||
fill="#BCD1CF"
|
||||
d="M100.4,17c0,1.6-0.5,2.9-1.4,3.9c-0.9,1-2.1,1.6-3.6,1.6c-1.5,0-2.6-0.5-3.5-1.6s-1.4-2.3-1.4-3.9v-0.2 c0-1.6,0.4-2.9,1.3-3.9s2.1-1.6,3.5-1.6c1.5,0,2.7,0.5,3.6,1.6s1.4,2.4,1.4,3.9V17z M98.2,16.8c0-1.1-0.2-2-0.7-2.7s-1.2-1-2.1-1 s-1.6,0.3-2,1s-0.7,1.6-0.7,2.7V17c0,1.1,0.2,2.1,0.7,2.8c0.5,0.7,1.1,1,2,1c0.9,0,1.6-0.3,2.1-1c0.5-0.7,0.7-1.6,0.7-2.8V16.8z"
|
||||
id="path47" /><path
|
||||
fill="#BCD1CF"
|
||||
d="M107,11.5c1.2,0,2.2,0.3,2.9,1s1.1,1.5,1.1,2.5c0,1-0.4,1.9-1.1,2.5c-0.7,0.6-1.7,0.9-2.9,0.9h-1.8v2.4 l1.2,0.2v1.3h-4.5V21l1.2-0.2V13l-1.2-0.2v-1.3h1.2H107z M105.2,16.7h1.8c0.6,0,1.1-0.2,1.4-0.5s0.5-0.8,0.5-1.3 c0-0.5-0.2-1-0.5-1.3c-0.3-0.3-0.8-0.5-1.4-0.5h-1.8V16.7z"
|
||||
id="path49" /><path
|
||||
fill="#BCD1CF"
|
||||
d="M119.3,17.6h-3.7v3.1h3.5l0.1-1.3h1.7v3h-8.6V21l1.2-0.2V13l-1.2-0.2v-1.3h1.2h7.4v3h-1.7l-0.1-1.3h-3.5 v2.7h3.7V17.6z"
|
||||
id="path51" /><path
|
||||
fill="#FFFFFF"
|
||||
d="M134.3,11.6l0.1,1.1c0.2-0.4,0.5-0.7,0.9-1c0.4-0.2,0.8-0.4,1.3-0.4c0.5,0,0.8,0.1,1.1,0.3 c0.3,0.2,0.5,0.5,0.7,0.8c0.2-0.3,0.5-0.6,0.8-0.8c0.3-0.2,0.7-0.3,1.2-0.3c0.4,0,0.7,0.1,1,0.2c0.3,0.1,0.5,0.3,0.8,0.6 c0.2,0.3,0.4,0.6,0.5,1c0.1,0.4,0.2,0.9,0.2,1.4v7.8h-2.2v-7.9c0-0.4-0.1-0.7-0.3-0.9c-0.2-0.2-0.4-0.2-0.7-0.2 c-0.3,0-0.5,0.1-0.6,0.2s-0.3,0.3-0.3,0.5v8.3h-2.2v-7.9c0-0.4-0.1-0.7-0.3-0.9c-0.2-0.2-0.4-0.3-0.7-0.3c-0.3,0-0.5,0.1-0.7,0.2 c-0.2,0.1-0.3,0.3-0.4,0.5v8.3h-2.2V11.6H134.3z"
|
||||
id="path53" /><path
|
||||
fill="#FFFFFF"
|
||||
d="M145.6,11.6h5.7v8.8h3.2v2h-8.9v-2h3.3v-6.8h-3.3V11.6z M148.7,8.8c0-0.4,0.1-0.7,0.4-0.9 c0.2-0.2,0.6-0.4,1-0.4c0.4,0,0.8,0.1,1,0.4c0.2,0.2,0.4,0.5,0.4,0.9c0,0.4-0.1,0.7-0.4,0.9c-0.2,0.2-0.6,0.4-1,0.4 c-0.4,0-0.8-0.1-1-0.4C148.9,9.5,148.7,9.2,148.7,8.8z"
|
||||
id="path55" /><path
|
||||
fill="#FFFFFF"
|
||||
d="M159.4,11.6l0.1,1.5c0.4-0.5,0.9-1,1.4-1.2c0.6-0.3,1.2-0.4,1.8-0.4c0.5,0,1,0.1,1.5,0.2 c0.5,0.2,0.8,0.4,1.2,0.7c0.3,0.3,0.6,0.8,0.8,1.3c0.2,0.5,0.3,1.2,0.3,1.9v6.7h-2.4v-6.7c0-0.4-0.1-0.8-0.2-1.1 c-0.1-0.3-0.2-0.5-0.4-0.7c-0.2-0.2-0.4-0.3-0.7-0.4c-0.3-0.1-0.6-0.1-0.9-0.1c-0.5,0-1,0.1-1.4,0.3c-0.4,0.2-0.7,0.5-0.9,0.9 v7.7h-2.4V11.6H159.4z"
|
||||
id="path57" /><path
|
||||
fill="#FFFFFF"
|
||||
d="M170,11.6h5.7v8.8h3.2v2H170v-2h3.3v-6.8H170V11.6z M173.1,8.8c0-0.4,0.1-0.7,0.4-0.9 c0.2-0.2,0.6-0.4,1-0.4c0.4,0,0.8,0.1,1,0.4c0.2,0.2,0.4,0.5,0.4,0.9c0,0.4-0.1,0.7-0.4,0.9c-0.2,0.2-0.6,0.4-1,0.4 c-0.4,0-0.8-0.1-1-0.4C173.2,9.5,173.1,9.2,173.1,8.8z"
|
||||
id="path59" /></g></g></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="179.9" height="32.4" viewBox="0 0 179.9 32.4">
|
||||
<path fill="#495260" d="M33.1 11.2h-8.5V5.8c0-2.3 1.9-4.2 4.2-4.2 2.3 0 4.2 1.9 4.2 4.2v5.4z"/>
|
||||
<path fill="#7F96A1" d="M25.8 3.6H32v7.6h-6.2z"/>
|
||||
<path fill="#845B32" d="M12.2 7.2V18h12.5V7.2c0-3.4-2.8-6.2-6.2-6.2s-6.3 2.8-6.3 6.2z"/>
|
||||
<path fill="#26A7AA" d="M28.9 31.4H8.7c-6.3 0-9-8-4-11.8L16 11.2h17.1v16c0 2.3-1.9 4.2-4.2 4.2z"/>
|
||||
<path fill="#43C9C9" d="M15.2 17.7l-8.8.7 10.7-8"/>
|
||||
<path fill="#F6F4E7" d="M14.8 15.1l2.3-4.7 1.5 4.7m0 0l1.4-4.7 2.3 4.7"/>
|
||||
<path fill="#BDD1CF" d="M21.9 17.7h-6.7l-.4-2.6h7.5"/>
|
||||
<path fill="#F6F4E7" d="M26.8 31.4c-.6-4.6-1.9-10.2-4.8-13.7h-6.8c-3 3.5-4.2 9.1-4.8 13.7h16.4z"/>
|
||||
<path fill="#FFCD9A" d="M18.6 10.5c-1.4 0-2.6-1.2-2.6-2.6V5h5.1v2.9c0 1.5-1.1 2.6-2.5 2.6z"/>
|
||||
<path fill="#BDD1CF" d="M15.4 31.4V17.7c2.2 5.1 4.9 11.3 8.2 13.7h-8.2z"/>
|
||||
<path fill="#FFCD9A" d="M17.1 10.4l1.5 4.7 1.4-4.7"/>
|
||||
<path fill="#43C9C9" d="M25.8 11.2h7.3v9.4"/>
|
||||
<path fill="#BCD1CF" d="M52.3 15.1h-1.6l-.2-1.4c-.2-.2-.5-.4-.8-.5s-.7-.2-1.2-.2c-.9 0-1.7.3-2.2 1s-.8 1.6-.8 2.7v.4c0 1.1.3 2 .8 2.7.5.7 1.2 1 2.1 1 .4 0 .8-.1 1.2-.2.4-.1.6-.3.8-.5l.2-1.4h1.6v2.1c-.4.5-1 .9-1.7 1.2-.7.3-1.4.5-2.3.5-1.5 0-2.6-.5-3.6-1.5s-1.4-2.3-1.4-3.9v-.4c0-1.6.5-2.9 1.4-3.9s2.1-1.5 3.6-1.5c.8 0 1.6.2 2.3.5.7.3 1.2.7 1.7 1.2v2.1zm1.5 5.9l.8-.1 3.3-9.4h2.2l3.3 9.4.8.1v1.3h-3.7V21l.8-.1-.5-1.5h-3.5l-.5 1.5.8.1v1.3h-3.7V21zm3.9-3.2h2.5L59 14l-1.3 3.8zm7.8 4.5V21l1.2-.2V13l-1.2-.2v-1.3H70v1.3l-1.2.2v7.6h3.1l.1-1.4h1.7v3h-8.2zm9.5 0V21l1.2-.2V13l-1.2-.2v-1.3h4.6v1.3l-1.3.2v7.6h3.1l.1-1.4h1.7v3H75zm9.5-9.5v-1.3H89v1.3l-1.1.2v7.8l1.1.2v1.3h-4.5V21l1.2-.2V13l-1.2-.2zm15.9 4.2c0 1.6-.5 2.9-1.4 3.9-.9 1-2.1 1.6-3.6 1.6s-2.6-.5-3.5-1.6-1.4-2.3-1.4-3.9v-.2c0-1.6.4-2.9 1.3-3.9s2.1-1.6 3.5-1.6c1.5 0 2.7.5 3.6 1.6s1.4 2.4 1.4 3.9v.2zm-2.2-.2c0-1.1-.2-2-.7-2.7s-1.2-1-2.1-1-1.6.3-2 1-.7 1.6-.7 2.7v.2c0 1.1.2 2.1.7 2.8.5.7 1.1 1 2 1 .9 0 1.6-.3 2.1-1s.7-1.6.7-2.8v-.2zm8.8-5.3c1.2 0 2.2.3 2.9 1S111 14 111 15s-.4 1.9-1.1 2.5c-.7.6-1.7.9-2.9.9h-1.8v2.4l1.2.2v1.3h-4.5V21l1.2-.2V13l-1.2-.2v-1.3h5.1zm-1.8 5.2h1.8c.6 0 1.1-.2 1.4-.5s.5-.8.5-1.3-.2-1-.5-1.3c-.3-.3-.8-.5-1.4-.5h-1.8v3.6zm14.1.9h-3.7v3.1h3.5l.1-1.3h1.7v3h-8.6V21l1.2-.2V13l-1.2-.2v-1.3h8.6v3h-1.7l-.1-1.3h-3.5v2.7h3.7v1.7z"/>
|
||||
<path fill="#FFF" d="M134.3 11.6l.1 1.1c.2-.4.5-.7.9-1 .4-.2.8-.4 1.3-.4s.8.1 1.1.3c.3.2.5.5.7.8.2-.3.5-.6.8-.8.3-.2.7-.3 1.2-.3.4 0 .7.1 1 .2.3.1.5.3.8.6.2.3.4.6.5 1 .1.4.2.9.2 1.4v7.8h-2.2v-7.9c0-.4-.1-.7-.3-.9-.2-.2-.4-.2-.7-.2-.3 0-.5.1-.6.2s-.3.3-.3.5v8.3h-2.2v-7.9c0-.4-.1-.7-.3-.9-.2-.2-.4-.3-.7-.3-.3 0-.5.1-.7.2-.2.1-.3.3-.4.5v8.3h-2.2V11.6h2zm11.3 0h5.7v8.8h3.2v2h-8.9v-2h3.3v-6.8h-3.3v-2zm3.1-2.8c0-.4.1-.7.4-.9.2-.2.6-.4 1-.4s.8.1 1 .4c.2.2.4.5.4.9s-.1.7-.4.9c-.2.2-.6.4-1 .4s-.8-.1-1-.4c-.2-.2-.4-.5-.4-.9zm10.7 2.8l.1 1.5c.4-.5.9-1 1.4-1.2.6-.3 1.2-.4 1.8-.4.5 0 1 .1 1.5.2.5.2.8.4 1.2.7.3.3.6.8.8 1.3.2.5.3 1.2.3 1.9v6.7h-2.4v-6.7c0-.4-.1-.8-.2-1.1-.1-.3-.2-.5-.4-.7-.2-.2-.4-.3-.7-.4-.3-.1-.6-.1-.9-.1-.5 0-1 .1-1.4.3-.4.2-.7.5-.9.9v7.7h-2.4V11.6h2.2zm10.6 0h5.7v8.8h3.2v2H170v-2h3.3v-6.8H170v-2zm3.1-2.8c0-.4.1-.7.4-.9.2-.2.6-.4 1-.4s.8.1 1 .4c.2.2.4.5.4.9s-.1.7-.4.9c-.2.2-.6.4-1 .4s-.8-.1-1-.4c-.3-.2-.4-.5-.4-.9z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 3.2 KiB |
@ -2,7 +2,7 @@
|
||||
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 251.8 222.2" enable-background="new 0 0 251.8 222.2" xml:space="preserve">
|
||||
viewBox="0 0 251.8 222.2" width="251.8" height="222.2" enable-background="new 0 0 251.8 222.2" xml:space="preserve">
|
||||
<symbol id="Mini_front" viewBox="-121.4 -112.4 242.4 214.1">
|
||||
<g>
|
||||
|
||||
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
BIN
docs/static/mb/device/croc-clips/badclamp.jpg
vendored
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
docs/static/mb/device/croc-clips/crocclipsclamped.jpg
vendored
Normal file
After Width: | Height: | Size: 91 KiB |
BIN
docs/static/mb/device/croc-clips/foilcircuit.jpg
vendored
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
docs/static/mb/device/croc-clips/foilcut.jpg
vendored
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
docs/static/mb/device/croc-clips/frontclamp.jpg
vendored
Normal file
After Width: | Height: | Size: 93 KiB |
BIN
docs/static/mb/device/croc-clips/groundconnected.jpg
vendored
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
docs/static/mb/device/croc-clips/jackconnect.jpg
vendored
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
docs/static/mb/device/croc-clips/jackground.jpg
vendored
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
docs/static/mb/device/croc-clips/microbitattached.jpg
vendored
Normal file
After Width: | Height: | Size: 85 KiB |
BIN
docs/static/mb/device/croc-clips/microbitconnect.jpg
vendored
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
docs/static/mb/device/croc-clips/sideclamp.jpg
vendored
Normal file
After Width: | Height: | Size: 34 KiB |
42
libs/calliope-test/calliope.ts
Normal file
@ -0,0 +1,42 @@
|
||||
basic.showString("RGB")
|
||||
basic.setLedColor(Colors.Blue)
|
||||
basic.pause(500)
|
||||
basic.setLedColor(Colors.Red)
|
||||
basic.pause(500)
|
||||
basic.setLedColor(Colors.Green)
|
||||
basic.pause(500)
|
||||
basic.setLedColor(Colors.Violet)
|
||||
basic.pause(500)
|
||||
basic.setLedColor(0);
|
||||
basic.showString("Gesten")
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.showString("S")
|
||||
})
|
||||
input.onGesture(Gesture.LogoUp, () => {
|
||||
basic.showString("U")
|
||||
})
|
||||
input.onGesture(Gesture.LogoDown, () => {
|
||||
basic.showString("D")
|
||||
})
|
||||
input.onGesture(Gesture.ScreenUp, () => {
|
||||
basic.showString("+")
|
||||
})
|
||||
input.onGesture(Gesture.TiltRight, () => {
|
||||
basic.showString("R")
|
||||
})
|
||||
input.onGesture(Gesture.FreeFall, () => {
|
||||
basic.showString("F")
|
||||
})
|
||||
input.onGesture(Gesture.ScreenDown, () => {
|
||||
basic.showString("-")
|
||||
})
|
||||
input.onGesture(Gesture.TiltLeft, () => {
|
||||
basic.showString("L")
|
||||
})
|
||||
input.onGesture(Gesture.ThreeG, () => {
|
||||
basic.showString("3")
|
||||
})
|
||||
input.onGesture(Gesture.SixG, () => {
|
||||
basic.showString("6")
|
||||
})
|
||||
|
11
libs/calliope-test/pxt.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "calliope",
|
||||
"description": "Test of Calliope Parts",
|
||||
"files": [
|
||||
"calliope.ts"
|
||||
],
|
||||
"public": true,
|
||||
"dependencies": {
|
||||
"core": "file:../core"
|
||||
}
|
||||
}
|
80
libs/core/_locales/ja/core-strings.json
Normal file
@ -0,0 +1,80 @@
|
||||
{
|
||||
"Math.randomBoolean|block": "pick random true or false",
|
||||
"Math|block": "Math",
|
||||
"String.fromCharCode|block": "text from char code %code",
|
||||
"String|block": "String",
|
||||
"basic.clearScreen|block": "clear screen",
|
||||
"basic.forever|block": "forever",
|
||||
"basic.pause|block": "pause (ms) %pause",
|
||||
"basic.showLeds|block": "show leds",
|
||||
"basic.showNumber|block": "show|number %number",
|
||||
"basic.showString|block": "show|string %text",
|
||||
"basic|block": "basic",
|
||||
"control.inBackground|block": "run in background",
|
||||
"control.reset|block": "reset",
|
||||
"control.waitMicros|block": "wait (µs)%micros",
|
||||
"control|block": "control",
|
||||
"game.addScore|block": "change score by|%points",
|
||||
"game.gameOver|block": "game over",
|
||||
"game.score|block": "score",
|
||||
"game.startCountdown|block": "start countdown|(ms) %duration",
|
||||
"game|block": "game",
|
||||
"images.createBigImage|block": "create big image",
|
||||
"images.createImage|block": "create image",
|
||||
"images|block": "images",
|
||||
"input.acceleration|block": "acceleration (mg)|%NAME",
|
||||
"input.buttonIsPressed|block": "button|%NAME|is pressed",
|
||||
"input.compassHeading|block": "compass heading (°)",
|
||||
"input.lightLevel|block": "light level",
|
||||
"input.magneticForce|block": "magnetic force (µT)|%NAME",
|
||||
"input.onButtonPressed|block": "on button|%NAME|pressed",
|
||||
"input.onGesture|block": "on |%NAME",
|
||||
"input.onPinPressed|block": "on pin %NAME|pressed",
|
||||
"input.onPinReleased|block": "on pin %NAME|released",
|
||||
"input.pinIsPressed|block": "pin %NAME|is pressed",
|
||||
"input.rotation|block": "rotation (°)|%NAME",
|
||||
"input.runningTime|block": "running time (ms)",
|
||||
"input.setAccelerometerRange|block": "set accelerometer|range %range",
|
||||
"input.temperature|block": "temperature (°C)",
|
||||
"input|block": "input",
|
||||
"led.brightness|block": "brightness",
|
||||
"led.plotBarGraph|block": "plot bar graph of %value |up to %high",
|
||||
"led.plot|block": "plot|x %x|y %y",
|
||||
"led.point|block": "point|x %x|y %y",
|
||||
"led.setBrightness|block": "set brightness %value",
|
||||
"led.stopAnimation|block": "stop animation",
|
||||
"led.toggle|block": "toggle|x %x|y %y",
|
||||
"led.unplot|block": "unplot|x %x|y %y",
|
||||
"led|block": "led",
|
||||
"music.beat|block": "%fraction|beat",
|
||||
"music.changeTempoBy|block": "change tempo by (bpm)|%value",
|
||||
"music.noteFrequency|block": "%note",
|
||||
"music.playTone|block": "play|tone %note=device_note|for %duration=device_beat",
|
||||
"music.rest|block": "rest(ms)|%duration=device_beat",
|
||||
"music.ringTone|block": "ring tone (Hz)|%note=device_note",
|
||||
"music.setTempo|block": "set tempo to (bpm)|%value",
|
||||
"music.tempo|block": "tempo (bpm)",
|
||||
"music|block": "music",
|
||||
"pins.analogReadPin|block": "analog read|pin %name",
|
||||
"pins.analogSetPeriod|block": "analog set period|pin %pin|to (µs)%micros",
|
||||
"pins.analogWritePin|block": "analog write|pin %name|to %value",
|
||||
"pins.digitalReadPin|block": "digital read|pin %name",
|
||||
"pins.digitalWritePin|block": "digital write|pin %name|to %value",
|
||||
"pins.i2cReadNumber|block": "i2c read number|at address %address|of format %format=i2c_sizeof",
|
||||
"pins.i2cWriteNumber|block": "i2c write number|at address %address|with value %value|of format %format=i2c_sizeof",
|
||||
"pins.map|block": "map %value|from low %fromLow|from high %fromHigh|to low %toLow|to high %toHigh",
|
||||
"pins.onPulsed|block": "on|pin %pin|pulsed %pulse",
|
||||
"pins.pulseDuration|block": "pulse duration (µs)",
|
||||
"pins.servoSetPulse|block": "servo set pulse|pin %value|to (µs) %micros",
|
||||
"pins.servoWritePin|block": "servo write|pin %name|to %value",
|
||||
"pins.setPull|block": "set pull|pin %pin|to %pull",
|
||||
"pins.spiWrite|block": "spi write %value",
|
||||
"pins|block": "pins",
|
||||
"serial.readLine|block": "serial read line",
|
||||
"serial.redirect|block": "serial redirect to|TX %tx|RX %rx|at baud rate %rate",
|
||||
"serial.writeLine|block": "serial|write line %text",
|
||||
"serial.writeNumber|block": "serial|write number %value",
|
||||
"serial.writeString|block": "serial write string %text",
|
||||
"serial.writeValue|block": "serial|write value %name|= %value",
|
||||
"serial|block": "serial"
|
||||
}
|
1
libs/core/dal.d.ts
vendored
@ -426,6 +426,7 @@ declare const enum DAL {
|
||||
MICROBIT_ACCELEROMETER_TILT_TOLERANCE = 200,
|
||||
MICROBIT_ACCELEROMETER_FREEFALL_TOLERANCE = 400,
|
||||
MICROBIT_ACCELEROMETER_SHAKE_TOLERANCE = 400,
|
||||
MICROBIT_ACCELEROMETER_2G_TOLERANCE = 2048,
|
||||
MICROBIT_ACCELEROMETER_3G_TOLERANCE = 3072,
|
||||
MICROBIT_ACCELEROMETER_6G_TOLERANCE = 6144,
|
||||
MICROBIT_ACCELEROMETER_8G_TOLERANCE = 8192,
|
||||
|
@ -130,7 +130,7 @@ namespace input {
|
||||
//% parts="accelerometer"
|
||||
void onGesture(Gesture gesture, Action body) {
|
||||
if ((int)gesture == MICROBIT_ACCELEROMETER_EVT_3G && uBit.accelerometer.getRange() < 3)
|
||||
uBit.accelerometer.setRange(4);
|
||||
uBit.accelerometer.setRange(6);
|
||||
else if ((int)gesture == MICROBIT_ACCELEROMETER_EVT_6G && uBit.accelerometer.getRange() < 6)
|
||||
uBit.accelerometer.setRange(8);
|
||||
registerWithDal(MICROBIT_ID_GESTURE, (int)gesture, body);
|
||||
|
@ -33,7 +33,9 @@
|
||||
"parts/speaker.svg",
|
||||
"parts/headphone.svg",
|
||||
"parts/dcmotor.svg",
|
||||
"_locales/fr/microbit-jsdoc-strings.json"
|
||||
"_locales/ja/core-jsdoc-strings.json",
|
||||
"_locales/ja/core-strings.json",
|
||||
"_locales/fr/core-jsdoc-strings.json"
|
||||
],
|
||||
"public": true,
|
||||
"dependencies": {},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-calliope",
|
||||
"version": "0.5.14",
|
||||
"version": "0.5.23",
|
||||
"description": "calliope target for PXT",
|
||||
"keywords": [
|
||||
"JavaScript",
|
||||
@ -29,6 +29,6 @@
|
||||
"typescript": "^1.8.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"pxt-core": "0.4.57"
|
||||
"pxt-core": "0.4.63"
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@
|
||||
"yottaTarget": "bbc-microbit-classic-gcc",
|
||||
"yottaCorePackage": "pxt-calliope-core",
|
||||
"githubCorePackage": "microsoft/pxt-calliope-core",
|
||||
"gittag": "v0.5.10",
|
||||
"gittag": "v0.5.11",
|
||||
"serviceId": "calliope"
|
||||
},
|
||||
"serial": {
|
||||
@ -212,7 +212,7 @@
|
||||
},
|
||||
"appTheme": {
|
||||
"accentColor": "#249899",
|
||||
"navMenuClass": "gray",
|
||||
"invertedMenu": true,
|
||||
"defaultLocale": "de",
|
||||
"logoUrl": "https://calliope.cc/about",
|
||||
"logo": "./static/Calliopeminieditor.svg",
|
||||
@ -252,7 +252,7 @@
|
||||
"path": "/browsers/windows"
|
||||
}
|
||||
],
|
||||
"boardName": "BBC micro:bit",
|
||||
"boardName": "Calliope MINI",
|
||||
"docMenu": [
|
||||
{
|
||||
"name": "Getting Started",
|
||||
|
@ -143,8 +143,7 @@ namespace pxsim.visuals {
|
||||
stroke-width: 2px;
|
||||
}
|
||||
`;
|
||||
const BOARD_SVG = `
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
const BOARD_SVG = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
@ -988,7 +987,7 @@ namespace pxsim.visuals {
|
||||
"C16, Serial - RX", "C17, Serial - TX", "+3v3", "GND"
|
||||
];
|
||||
const MB_WIDTH = 251.8;
|
||||
const MB_HEIGHT = 222.2;
|
||||
const MB_HEIGHT = 222.2;
|
||||
export interface IBoardTheme {
|
||||
accent?: string;
|
||||
display?: string;
|
||||
@ -1060,8 +1059,205 @@ namespace pxsim.visuals {
|
||||
private thermometerText: SVGTextElement;
|
||||
private shakeButton: SVGElement;
|
||||
public board: pxsim.DalBoard;
|
||||
private pinNmToCoord: Map<Coord>;
|
||||
private rgbLed: SVGElement;
|
||||
private pinNmToCoord: Map<Coord> = {
|
||||
"EXT_PWR": [
|
||||
92.30997467041016,
|
||||
-42.92474937438965
|
||||
],
|
||||
"SPKR": [
|
||||
106.44635391235352,
|
||||
-16.370698928833008
|
||||
],
|
||||
"BTN_A": [
|
||||
93.8138427734375,
|
||||
56.631452560424805
|
||||
],
|
||||
"BTN_B": [
|
||||
204.92835235595703,
|
||||
56.631452560424805
|
||||
],
|
||||
"EDGE_P0": [
|
||||
56.002254486083984,
|
||||
95.43130111694336
|
||||
],
|
||||
"EDGE_P1": [
|
||||
103.00893783569336,
|
||||
175.82388305664062
|
||||
],
|
||||
"EDGE_P2": [
|
||||
195.90512084960938,
|
||||
175.3082733154297
|
||||
],
|
||||
"EDGE_P3": [
|
||||
241.79466247558594,
|
||||
95.3883285522461
|
||||
],
|
||||
"EDGE_GND": [
|
||||
103.00893783569336,
|
||||
14.86682915687561
|
||||
],
|
||||
"EDGE_VCC": [
|
||||
195.64733123779297,
|
||||
14.86682915687561
|
||||
],
|
||||
"C_GND1": [
|
||||
113.1493148803711,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_GND2": [
|
||||
150.27342987060547,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_GND3": [
|
||||
150.27342987060547,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_GND4": [
|
||||
187.39752960205078,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_VCC1": [
|
||||
187.39752960205078,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_VCC2": [
|
||||
113.1922836303711,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P0": [
|
||||
119.33667373657227,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P2": [
|
||||
125.52401733398438,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P4": [
|
||||
131.71136474609375,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P6": [
|
||||
137.89871978759766,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P8": [
|
||||
144.08607482910156,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P10": [
|
||||
156.46077728271484,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P12": [
|
||||
162.64812469482422,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P14": [
|
||||
168.83545684814453,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P16": [
|
||||
175.02281951904297,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P20": [
|
||||
181.2101821899414,
|
||||
159.83989715576172
|
||||
],
|
||||
"C_P1": [
|
||||
119.379638671875,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P22": [
|
||||
125.56698226928711,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P5": [
|
||||
131.71136474609375,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P7": [
|
||||
137.89871978759766,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P9": [
|
||||
144.08607482910156,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P11": [
|
||||
156.46077728271484,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P13": [
|
||||
162.64812469482422,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P15": [
|
||||
168.83545684814453,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P21": [
|
||||
175.02281951904297,
|
||||
153.5666275024414
|
||||
],
|
||||
"C_P19": [
|
||||
181.2101821899414,
|
||||
153.5666275024414
|
||||
],
|
||||
"M_GND1": [
|
||||
137.89871978759766,
|
||||
141.70752716064453
|
||||
],
|
||||
"M_GND2": [
|
||||
156.46077728271484,
|
||||
141.70752716064453
|
||||
],
|
||||
"M_OUT1": [
|
||||
144.08607482910156,
|
||||
141.70752716064453
|
||||
],
|
||||
"M_OUT2": [
|
||||
150.27342987060547,
|
||||
141.70752716064453
|
||||
],
|
||||
"M_VM": [
|
||||
162.64812469482422,
|
||||
141.70752716064453
|
||||
],
|
||||
"G_A0_GND": [
|
||||
82.47036743164062,
|
||||
72.35763549804688
|
||||
],
|
||||
"G_A0_VCC": [
|
||||
78.34546279907227,
|
||||
76.3106689453125
|
||||
],
|
||||
"G_A0_SDA": [
|
||||
74.65023803710938,
|
||||
80.00588989257812
|
||||
],
|
||||
"G_A0_SCL": [
|
||||
70.43940734863281,
|
||||
84.21672821044922
|
||||
],
|
||||
"G_A1_RX": [
|
||||
216.52963256835938,
|
||||
71.4982795715332
|
||||
],
|
||||
"G_A1_TX": [
|
||||
220.65453338623047,
|
||||
75.53724670410156
|
||||
],
|
||||
"G_A1_VCC": [
|
||||
224.34976959228516,
|
||||
79.23247528076172
|
||||
],
|
||||
"G_A1_GND": [
|
||||
228.56060028076172,
|
||||
83.44330978393555
|
||||
]
|
||||
};
|
||||
|
||||
constructor(public props: IBoardProps) {
|
||||
this.buildDom();
|
||||
@ -1090,7 +1286,6 @@ namespace pxsim.visuals {
|
||||
}
|
||||
|
||||
public getCoord(pinNm: string): Coord {
|
||||
if (!this.pinNmToCoord) this.recordPinCoords();
|
||||
return this.pinNmToCoord[pinNm];
|
||||
}
|
||||
|
||||
@ -1102,14 +1297,13 @@ namespace pxsim.visuals {
|
||||
return 10;
|
||||
}
|
||||
|
||||
public recordPinCoords() {
|
||||
this.pinNmToCoord = {};
|
||||
pinNames.forEach((nm,i) => {
|
||||
// TODO: position pins from SVG
|
||||
private recordPinCoords() {
|
||||
pinNames.forEach((nm, i) => {
|
||||
const p = this.pins[i];
|
||||
const r = p.getBoundingClientRect();
|
||||
this.pinNmToCoord[nm] = [r.left + r.width / 2, r.top + r.height / 2];
|
||||
});
|
||||
console.log(JSON.stringify(this.pinNmToCoord, null, 2))
|
||||
}
|
||||
|
||||
private updateTheme() {
|
||||
@ -1169,7 +1363,7 @@ namespace pxsim.visuals {
|
||||
const g = (c >> 8) & 0xFF;
|
||||
const r = (c >> 16) & 0xFF;
|
||||
const w = (c >> 24) & 0xFF;
|
||||
const ch = `rgba(${r}, ${g}, ${b}, 1)`;
|
||||
const ch = `rgba(${r}, ${g}, ${b}, 1)`;
|
||||
svg.fill(this.rgbLed, ch);
|
||||
} else if (this.rgbLed) {
|
||||
svg.fill(this.rgbLed, 'white');
|
||||
@ -1247,8 +1441,10 @@ namespace pxsim.visuals {
|
||||
rx: 5, ry: 5,
|
||||
fill: `url(#${gid})`
|
||||
});
|
||||
this.thermometerText = svg.child(this.g, "text", { class: 'sim-text',
|
||||
x: 100, y: MB_HEIGHT - 174 }) as SVGTextElement;
|
||||
this.thermometerText = svg.child(this.g, "text", {
|
||||
class: 'sim-text',
|
||||
x: 100, y: MB_HEIGHT - 174
|
||||
}) as SVGTextElement;
|
||||
this.updateTheme();
|
||||
|
||||
let pt = this.element.createSVGPoint();
|
||||
@ -1357,7 +1553,7 @@ namespace pxsim.visuals {
|
||||
}
|
||||
}, ev => { },
|
||||
ev => { })
|
||||
this.lightLevelText = svg.child(this.g, "text", { x: cx-r-7, y: cy + r + 8, text: '', class: 'sim-text inverted' }) as SVGTextElement;
|
||||
this.lightLevelText = svg.child(this.g, "text", { x: cx - r - 7, y: cy + r + 8, text: '', class: 'sim-text inverted' }) as SVGTextElement;
|
||||
this.updateTheme();
|
||||
}
|
||||
|
||||
@ -1386,8 +1582,7 @@ namespace pxsim.visuals {
|
||||
}
|
||||
|
||||
private buildDom() {
|
||||
this.element = <SVGSVGElement>svg.elt("svg")
|
||||
this.element.innerHTML = BOARD_SVG;
|
||||
this.element = new DOMParser().parseFromString(BOARD_SVG, "image/svg+xml").querySelector("svg") as SVGSVGElement;
|
||||
svg.hydrate(this.element, {
|
||||
"version": "1.0",
|
||||
"viewBox": `0 0 ${MB_WIDTH} ${MB_HEIGHT}`,
|
||||
|