Compare commits
177 Commits
Author | SHA1 | Date | |
---|---|---|---|
566b750419 | |||
b119952e75 | |||
e4e6a5effd | |||
ec1117842d | |||
de4242bf71 | |||
59322fb06b | |||
19e609c245 | |||
a5cb663316 | |||
1dd0c1793e | |||
a4a74bdd6b | |||
45c82767d0 | |||
0c77927f35 | |||
672672e632 | |||
fe2ae855b0 | |||
6612080885 | |||
8641a81e05 | |||
656e183a1a | |||
1d56be507a | |||
6504007a65 | |||
fc0526e47c | |||
cb47a6a291 | |||
6f8060a8c7 | |||
4a8897c0a4 | |||
839a26e5a7 | |||
b46802804c | |||
34d1fac337 | |||
39c41f26b1 | |||
083a192a5b | |||
76cbad0cec | |||
ed84d49667 | |||
b9d867cf4e | |||
226dfa281a | |||
cc4f6c66da | |||
49ecac6332 | |||
638e1d3c53 | |||
712bc0ada4 | |||
8437f0cf3c | |||
9641c4b5ec | |||
e29216c709 | |||
06e255eeb9 | |||
91c70e9809 | |||
8014712994 | |||
a7d5804cea | |||
2e5984a65b | |||
c13bef01a4 | |||
16c08e4c9b | |||
444c37edcb | |||
51781be90b | |||
741eb4e4b4 | |||
350f595a52 | |||
06c392f16f | |||
4bf659c9ac | |||
db4711fd26 | |||
8275fefd08 | |||
8c474c899c | |||
48bb0e238a | |||
1d47b4de0d | |||
595e4a23e6 | |||
2d3ca71ffb | |||
3ba9d2867b | |||
ff7b229a3a | |||
f944af8122 | |||
35225468e4 | |||
72d5e83e5b | |||
436b56a2fa | |||
7a41730f82 | |||
372ddfa641 | |||
30078923a3 | |||
5ab9222200 | |||
8ae5a48f1e | |||
f9ed37d07b | |||
edfbc4da18 | |||
3a1c6a6ce3 | |||
9a4a2264fa | |||
e9558ce158 | |||
50677fadc4 | |||
649e8f7c0f | |||
0cb9c28f8d | |||
004d9b4315 | |||
7a5b3aba01 | |||
dc30263642 | |||
619658a057 | |||
472846bf3c | |||
ac4fbc850b | |||
c7054b7ee0 | |||
559a43e17b | |||
7671bc46ad | |||
b3c5f2926d | |||
28830aa905 | |||
7fbbb5e65a | |||
51ebc29887 | |||
f5d1722eae | |||
5f876d5ea9 | |||
31de8892fa | |||
0d0a68122d | |||
4ad660568e | |||
58e82a571d | |||
e629b866d5 | |||
f0ac2b7a05 | |||
e3c8db28e4 | |||
2c0e19a120 | |||
595eb788b2 | |||
2e15d22e9e | |||
57082654a9 | |||
8cbf7d38e3 | |||
a99a7325bf | |||
fa3ed9dd21 | |||
45fd40a553 | |||
5a18bea9eb | |||
d310312841 | |||
a4b93f7199 | |||
538a4b7bbf | |||
0078e7bc12 | |||
d2726133a9 | |||
00f4c9cbb3 | |||
e15da5dee1 | |||
85dda4ea84 | |||
a3ffe4e1cf | |||
90c4d4f73b | |||
6484d559d6 | |||
357436f14d | |||
85fe96b3fd | |||
cdac932c42 | |||
dcfc2a110d | |||
e9561f54c3 | |||
86f6b58d38 | |||
eee52a5c04 | |||
1a0b0eac71 | |||
5a98ae0bb8 | |||
a9eea9a618 | |||
3086c521e3 | |||
6788f79650 | |||
5900239045 | |||
248267ec2c | |||
9429075555 | |||
1fa871f2e7 | |||
04dab7df2c | |||
b6474467bc | |||
79ead74af4 | |||
0f8ff95b72 | |||
05028c4527 | |||
4054da3483 | |||
7052d27d6d | |||
365af8d672 | |||
5086ca308c | |||
c1af770afc | |||
e175e70d01 | |||
cbc228dca3 | |||
462127c661 | |||
487da05eca | |||
c938618d29 | |||
91321dab83 | |||
0cb3d6e44e | |||
7a98b06424 | |||
69c80d3aff | |||
1d82f08668 | |||
4681a68ffd | |||
0a69b773de | |||
3f66a1c16d | |||
d78781ad5a | |||
46281c3cd0 | |||
a58f67064f | |||
efe784441f | |||
05174f094a | |||
42773a1a0a | |||
32f96d09d4 | |||
05d88cb4ba | |||
7fe8dad1f6 | |||
858766ea3e | |||
81fe9afbb7 | |||
65c615f256 | |||
c5128aa497 | |||
d2d776fd01 | |||
641a5e9673 | |||
03111368e0 | |||
a973b2aec6 | |||
c10761128e |
2
.vscode/settings.json
vendored
@ -1,6 +1,6 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
"file.autoSave": "afterDelay",
|
||||
"files.autoSave": "afterDelay",
|
||||
"files.watcherExclude": {
|
||||
"**/.git/objects/**": true,
|
||||
"**/built/**": true,
|
||||
|
43
THIRD-PARTY-NOTICES.txt
Normal file
@ -0,0 +1,43 @@
|
||||
/*!----------------- PXT ThirdPartyNotices -------------------------------------------------------
|
||||
|
||||
PXT uses third party material from the projects listed below.
|
||||
The original copyright notice and the license under which Microsoft
|
||||
received such third party material are set forth below. Microsoft
|
||||
reserves all other rights not expressly granted, whether by
|
||||
implication, estoppel or otherwise.
|
||||
|
||||
In the event that we accidentally failed to list a required notice, please
|
||||
bring it to our attention. Post an issue or email us:
|
||||
|
||||
abchatra@microsoft.com
|
||||
|
||||
---------------------------------------------
|
||||
Third Party Code Components
|
||||
---------------------------------------------
|
||||
|
||||
Some code derived (as noted) from
|
||||
|
||||
https://github.com/bbcmicrobit/micropython
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2016 The MicroPython-on-micro:bit Developers, as listed
|
||||
in the accompanying AUTHORS file
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
@ -1,5 +1,5 @@
|
||||
# microbit-chrome
|
||||
Prototype chrome addon that exposes the micro:bit's serial output to webpages.
|
||||
Prototype chrome addon that exposes the @boardname@'s serial output to webpages.
|
||||
* watch the [demo video](https://vimeo.com/146207766)
|
||||
|
||||
# Installation
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
### @description Language constructs for the Block editor.
|
||||
|
||||
Blocks snap into each other to define the program that your @boardname@ will run.
|
||||
Blocks can be event (buttons, shake, ...) or need to be snapped into an event to run.
|
||||
The [on-start](/blocks/on-start) event runs first.
|
||||
|
||||
```namespaces
|
||||
for (let i = 0;i<5;++i) {}
|
||||
if (true){}
|
||||
|
@ -16,7 +16,13 @@ input.onButtonPressed(Button.A, () => {
|
||||
led.setBrightness(50)
|
||||
```
|
||||
|
||||
|
||||
## What about JavaScript?
|
||||
|
||||
``on-start`` only exists in the block editor. In JavaScript, all code executes sequentially from the first line.
|
||||
|
||||
## Hey, my events moved!
|
||||
|
||||
When we transform the blocks into JavaScript, we always place all the event registrations (buttons, shake, ...)
|
||||
before launching the ``on start`` code.
|
||||
|
||||
If a block from ``on start`` pauses, other registered events will have the opportunity to run as well.
|
@ -1,13 +1,4 @@
|
||||
# Preparing the servo
|
||||
### @description Connecting the servo to crocodile clips
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
Equip the microservo with crocodile clips.
|
||||
|
||||
### ~
|
||||
|
||||
## Duration: ~30 minutes
|
||||
# Equipping a microservo with Crocodile clips
|
||||
|
||||
## Materials
|
||||
* Cutting pliers or wire cutter
|
||||
@ -41,7 +32,7 @@ Using the cutting pliers, cut out the dark plastic connector.
|
||||
|
||||
Using the plier or a wire stripper, strip the plastic from the cables.
|
||||
|
||||

|
||||

|
||||
|
||||
## Step 3: threading the servo cablers
|
||||
|
||||
@ -70,7 +61,7 @@ Place the cables next to each other
|
||||
|
||||
It is very **important** to ensure that there is a good connection between the 2 cables.
|
||||
If the connection is weak, the microservo will not receive enough current and it will not work.
|
||||
If you have access to a soldering iron, we strongly recommend to solver this connection.
|
||||
**If you have access to a soldering iron, we strongly recommend to solder this connection.**
|
||||
|
||||
### ~
|
||||
|
||||
@ -105,11 +96,9 @@ When attaching the crocodile clips to the pins, don't hesitate to grab the side
|
||||
* Download the following code to your @boardname@
|
||||
|
||||
```blocks
|
||||
let a = 0
|
||||
basic.forever(() => {
|
||||
a = input.acceleration(Dimension.X)
|
||||
pins.servoWritePin(AnalogPin.P0, pins.map(
|
||||
a,
|
||||
input.acceleration(Dimension.X),
|
||||
-512,
|
||||
512,
|
||||
0,
|
||||
@ -121,10 +110,7 @@ basic.forever(() => {
|
||||
* When powered by USB, make sure that the servo moves when you tilt the board.
|
||||
* When powered by batteries **only**, make sure that the servo moves when you tilt the board.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If your servo seems to sutter and stay stuck at a particular position, it means that it is not receiving enough power.
|
||||
This is probably due to a weak connection or low battery level. Check each connection and check your batteries.
|
||||
|
||||
|
||||
### ~button /projects/inchworm/chassis
|
||||
NEXT: Chassis
|
||||
### ~
|
||||
This is probably due to a weak connection or low battery level. Check each connection and check your batteries.
|
@ -6,6 +6,7 @@
|
||||
|
||||
* **[Getting Started](/getting-started)**
|
||||
* [Projects](/projects)
|
||||
* [Examples](/examples)
|
||||
* [Lessons](/lessons)
|
||||
|
||||
### @boardname@ reference
|
||||
|
35
docs/examples.md
Normal file
@ -0,0 +1,35 @@
|
||||
# Examples
|
||||
|
||||
Here are some fun programs for your @boardname@!
|
||||
|
||||
## Fun stuff
|
||||
|
||||
```codecard
|
||||
[{
|
||||
"name": "Blinky",
|
||||
"url":"/examples/blinky"
|
||||
},
|
||||
{
|
||||
"name": "Name Tag",
|
||||
"url":"/examples/name-tag"
|
||||
},
|
||||
{
|
||||
"name": "Rando",
|
||||
"url":"/examples/rando"
|
||||
}]
|
||||
```
|
||||
|
||||
## Sensors
|
||||
|
||||
```codecard
|
||||
[{
|
||||
"name": "Plot Acceleration",
|
||||
"url":"/examples/plot-acceleration"
|
||||
}, {
|
||||
"name": "Plot Light Level",
|
||||
"url":"/examples/plot-light-level"
|
||||
}, {
|
||||
"name": "Plot Analog Pin",
|
||||
"url":"/examples/plot-analog-pin"
|
||||
}]
|
||||
```
|
20
docs/examples/blinky.md
Normal file
@ -0,0 +1,20 @@
|
||||
# Blinky
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
);
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .`
|
||||
);
|
||||
})
|
||||
```
|
7
docs/examples/name-tag.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Name Tag
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showString("JAMES")
|
||||
})
|
||||
```
|
10
docs/examples/plot-acceleration.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Plot Acceleration
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
led.plotBarGraph(
|
||||
input.acceleration(Dimension.X),
|
||||
1023
|
||||
)
|
||||
})
|
||||
```
|
10
docs/examples/plot-analog-pin.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Plot Analog Pin
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
led.plotBarGraph(
|
||||
pins.analogReadPin(AnalogPin.P0),
|
||||
1023
|
||||
)
|
||||
})
|
||||
```
|
10
docs/examples/plot-light-level.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Plot Light level
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
led.plotBarGraph(
|
||||
input.lightLevel(),
|
||||
255
|
||||
)
|
||||
})
|
||||
```
|
7
docs/examples/rando.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Rando
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
led.toggle(Math.random(5), Math.random(5))
|
||||
})
|
||||
```
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"appref": "v0.6.36"
|
||||
"appref": "v0.7.41"
|
||||
}
|
||||
|
@ -3,27 +3,48 @@
|
||||
You can publish libraries (also known as packages or extensions)
|
||||
that users can then add to their scripts. These typically
|
||||
provide a driver for a particular hardware device you can connect
|
||||
to a microbit.
|
||||
to a microbit.
|
||||
|
||||
### ~ hint
|
||||
|
||||
All packages need to be approved by the Micro:bit Foundation before being available in the web editor.
|
||||
See **Approval** section below.
|
||||
|
||||
### ~
|
||||
|
||||
* [pxt-max6675](https://github.com/Microsoft/pxt-max6675) -- TypeScript
|
||||
* [pxt-neopixel](https://github.com/Microsoft/pxt-neopixel) -- TypeScript + ARM Thumb assembly package
|
||||
* [pxt-max6675](https://github.com/Microsoft/pxt-max6675) -- TypeScript
|
||||
* [pxt-sonar](https://github.com/microsoft/pxt-sonar) -- TypeScript
|
||||
* [pxt-i2c-fram](https://github.com/microsoft/pxt-i2c-fram) -- TypeScript
|
||||
|
||||
* [Sample C++ extension](https://github.com/Microsoft/pxt-microbit-cppsample)
|
||||
* [Sample TypeScript extension](https://github.com/Microsoft/pxt-microbit/tree/master/libs/i2c-fram)
|
||||
|
||||
## Finding packages
|
||||
|
||||
From the editor, the user clicks on **More** then **Add Package** and searches for the package.
|
||||
From the block editor, the user clicks on **Add Package** and searches for the package.
|
||||
Otherwise, the **Add Package** is also available from the gearwheel menu.
|
||||
|
||||
To see the list of packages, click on **More** then **Show Files** to see the project file list.
|
||||
To see the list of packages, switch to JavaScript and use the **Explorer** view to find them.
|
||||
|
||||
To remove a package, click on the garbage button in the file list next to the package.
|
||||
To remove a package, click on the garbage button in the **Explorer** view next to the package.
|
||||
|
||||
## Publishing packages
|
||||
## Publishing and Approving packages
|
||||
|
||||
Packages can be published from the pxt command line. Check out [the docs](https://www.pxt.io/packages).
|
||||
Once your package is ready, follow these steps to get it approved and listed in the pxt.microbit.org web site:
|
||||
|
||||
1. setup a public GitHub repository with your package sources
|
||||
2. ensure that the license is **Apache2** or **MIT**
|
||||
3. fill ``test.ts`` with a test scenario
|
||||
4. ensure that the package builds by running ``pxt`` from the package folder. [Read more...](https://www.pxt.io/packages).
|
||||
5. fill up the ``README.md`` file with documentation. See [markdown docs](https://pxt.io/writing-docs) for syntax.
|
||||
6. publish a release by running ``pxt bump`` from the package folder.
|
||||
7. open a support ticket at https://support.microbit.org, add **package approval** in the subject line.
|
||||
|
||||
```
|
||||
Package approval request
|
||||
|
||||
github repo: .....
|
||||
```
|
||||
|
||||
## Localizing packages
|
||||
|
||||
|
@ -62,17 +62,13 @@ Fun games to build with your @boardname@.
|
||||
}]
|
||||
```
|
||||
|
||||
## Science and Engineering
|
||||
## Toys
|
||||
|
||||
```codecard
|
||||
[{
|
||||
"name": "Inchworm",
|
||||
"url":"/projects/inchworm",
|
||||
"imageUrl":"/static/mb/projects/inchworm.jpg"
|
||||
}, {
|
||||
"name": "Timing gates",
|
||||
"url":"/projects/timing-gates",
|
||||
"imageUrl":"/static/mb/projects/timing-gates.jpg"
|
||||
}]
|
||||
```
|
||||
|
||||
@ -80,6 +76,10 @@ Fun games to build with your @boardname@.
|
||||
|
||||
```codecard
|
||||
[{
|
||||
"name": "Timing gates",
|
||||
"url":"/projects/timing-gates",
|
||||
"imageUrl":"/static/mb/projects/timing-gates.jpg"
|
||||
}, {
|
||||
"name": "Compass",
|
||||
"url":"/projects/compass",
|
||||
"imageUrl":"/static/mb/projects/a5-compass.png"
|
||||
@ -96,4 +96,4 @@ Fun games to build with your @boardname@.
|
||||
|
||||
### See Also
|
||||
|
||||
[Flashing Heart](/projects/flashing-heart), [Smiley Buttons](/projects/smiley-buttons), [Love Meter](/projects/love-meter), [Rock Paper Scissors](/projects/rock-paper-scissors), [Compass](/projects/compass), [Hack your headphones](/projects/hack-your-headphones), [Banana keyboard](/projects/banana-keyboard), [Telegraph](/projects/telegraph), [Radio](/projects/radio), [Guitar](/projects/guitar), [Wallet](/projects/wallet), [Watch](/projects/watch)
|
||||
[Flashing Heart](/projects/flashing-heart), [Smiley Buttons](/projects/smiley-buttons), [Love Meter](/projects/love-meter), [Rock Paper Scissors](/projects/rock-paper-scissors), [Compass](/projects/compass), [Hack your headphones](/projects/hack-your-headphones), [Banana keyboard](/projects/banana-keyboard), [Telegraph](/projects/telegraph), [Radio](/projects/radio), [Guitar](/projects/guitar), [Wallet](/projects/wallet), [Watch](/projects/watch)
|
||||
|
@ -21,8 +21,8 @@ Build your own @boardname@ piano using bananas!
|
||||
|
||||
## Activities
|
||||
|
||||
* [Making the keyboard](/projects/banana-keyboard/make)
|
||||
* [Beat box](/projects/banana-keyboard/beat-box)
|
||||
* [Make](/projects/banana-keyboard/make)
|
||||
* [Code](/projects/banana-keyboard/code)
|
||||
|
||||
### ~button /projects/banana-keyboard/make
|
||||
Let's get started!
|
||||
|
@ -1,4 +1,4 @@
|
||||
# banana keyboard - beat box
|
||||
# Code
|
||||
|
||||
Have you ever tried to making beat box sounds? Let's try making a beatbox with code!
|
||||
|
@ -1,4 +1,4 @@
|
||||
# banana keyboard - making
|
||||
# Make
|
||||
|
||||
## Materials
|
||||
|
||||
@ -80,6 +80,6 @@ input.onPinPressed(TouchPin.P1, () => {
|
||||
|
||||
Tap your banana instrument to play sound against... the fruit!
|
||||
|
||||
### ~button /projects/banana-keyboard/beat-box
|
||||
### ~button /projects/banana-keyboard/code
|
||||
NEXT: beat box
|
||||
### ~
|
||||
|
43
docs/projects/coffee-cup-monster.md
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
# Coffee Cup Monster
|
||||
|
||||
### @description A monster made of cardboard that responds to light
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
Make a coffee cup monster that responds to light!
|
||||
|
||||
### ~
|
||||
|
||||
https://youtu.be/BiZLjugXMbM
|
||||
|
||||
## Duration
|
||||
|
||||
3 Activities, approx 30-45 min each based on familiarity with the coding concepts
|
||||
|
||||
## Materials
|
||||
|
||||
* 3 Coffee cup holders
|
||||
* 2 Coffee cup strirer wood sticks
|
||||
* Glue gun
|
||||
* Scissors that can cut cardboard
|
||||
* 1 @boardname@, battery holder and 2 AAA batteries
|
||||
* 3 Crocodile clips
|
||||
* 1 micro servo 9g SG90
|
||||
* 1 paper clip
|
||||
|
||||
## Preparation
|
||||
|
||||
* [Equip the microservo with crocodile clips](/device/servo)
|
||||
|
||||
## Activities
|
||||
|
||||
* [Make](/projects/coffee-cup-monster/make)
|
||||
* [Code](/projects/coffee-cup-monster/code)
|
||||
* [Connect](/projects/coffee-cup-monster/connect)
|
||||
|
||||
### ~button /projects/coffee-cup-monster/make
|
||||
|
||||
Let's get started!
|
||||
|
||||
### ~
|
29
docs/projects/coffee-cup-monster/code.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Code
|
||||
### @description code to make the coffee cup monster alive
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
Add code to open the mouth when light is detected.
|
||||
|
||||
### ~
|
||||
|
||||
## Duration: ~30 minutes
|
||||
|
||||
We are going to add code to open the mouth proportionally to the amount of light on the @boardname@.
|
||||
In a loop, we will read the light and map it to an angle using the ``pins.map`` function.
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
pins.servoWritePin(AnalogPin.P0, pins.map(
|
||||
input.lightLevel(),
|
||||
0,
|
||||
255,
|
||||
30,
|
||||
150
|
||||
))
|
||||
})
|
||||
```
|
||||
|
||||
### ~button /projects/coffee-cup-monster/connect
|
||||
NEXT: Connect
|
||||
### ~
|
29
docs/projects/coffee-cup-monster/connect.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Connect
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
Remote control your monster with another @boardname@
|
||||
|
||||
### ~
|
||||
|
||||
## Duration: ~30 minutes
|
||||
|
||||
You will need 2 @boardname@ for this part. By using the radio, we can make the inchworm controlled by another @boardname@.
|
||||
Download the code below to the @boardname@ on the inchworm and another "controller" @boardname@.
|
||||
Whenere A is pressed, the monster will open and close it's mouth will move once.
|
||||
|
||||
```blocks
|
||||
radio.onDataPacketReceived(({receivedNumber}) => {
|
||||
pins.servoWritePin(AnalogPin.P0, 30)
|
||||
basic.pause(500)
|
||||
pins.servoWritePin(AnalogPin.P0, 150)
|
||||
basic.pause(500)
|
||||
})
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
radio.sendNumber(0)
|
||||
})
|
||||
```
|
||||
|
||||
```package
|
||||
radio
|
||||
```
|
25
docs/projects/coffee-cup-monster/make.md
Normal file
@ -0,0 +1,25 @@
|
||||
# Make
|
||||
### @description Building the coffee cup monster
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
Turn a piece of coffee holders into a monster!
|
||||
|
||||
### ~
|
||||
|
||||
## Duration: ~60 minutes
|
||||
|
||||
## Materials
|
||||
* 3 Coffee cup holders
|
||||
* 2 Coffee cup strirer wood sticks
|
||||
* Scissors
|
||||
* glue gun or tape
|
||||
* 1 paper clip
|
||||
|
||||
## Step 1: cardboard
|
||||
|
||||
TODO
|
||||
|
||||
### ~button /projects/coffee-cup-monster/code
|
||||
NEXT: Code
|
||||
### ~
|
@ -21,7 +21,7 @@ Use pin press to switch guitar play on/off
|
||||
## Blocks
|
||||
|
||||
```cards
|
||||
var on = false
|
||||
let on = false
|
||||
on;
|
||||
if (on) { } else {}
|
||||
input.onPinPressed(TouchPin.P1, () => {})
|
||||
@ -106,7 +106,7 @@ input.onPinPressed(TouchPin.P1, () => {
|
||||
*Final code*
|
||||
TODO: do we want to use `on = !on;` or be more direct in flipping the switch? `on = true; on = false;`
|
||||
```blocks
|
||||
var on = false
|
||||
let on = false
|
||||
basic.forever(() => {
|
||||
if (on) {
|
||||
music.setTempo(pins.map(Math.abs(input.acceleration(Dimension.Y)),
|
||||
|
@ -27,8 +27,8 @@ Build your own music player @boardname@ from headphones.
|
||||
|
||||
## Activities
|
||||
|
||||
* [Connect your headphone](/projects/hack-your-headphones/make)
|
||||
* [Play sounds!]()
|
||||
* [Make](/projects/hack-your-headphones/make)
|
||||
* [Code](/projects/hack-your-headphones/code)
|
||||
|
||||
### ~button /projects/hack-your-headphones/make
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# hack your headphones - music of light
|
||||
# Code
|
||||
|
||||
### ~avatar avatar
|
||||
|
@ -1,4 +1,4 @@
|
||||
# hack your headphones - making
|
||||
# Make
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
@ -46,7 +46,7 @@ Using the 2nd crocodile clip, connect the second end of the crocodile clip onto
|
||||
|
||||
You hacked your headphones!
|
||||
|
||||
### ~button /projects/hack-your-headphones/music-of-light
|
||||
### ~button /projects/hack-your-headphones/code
|
||||
|
||||
NEXT: music of light
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
# Inchworm
|
||||
|
||||
### @description A inchworm like robot built with the micro:bit
|
||||
### @description A inchworm like robot built with the @boardname@
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
@ -27,13 +27,17 @@ https://youtu.be/BiZLjugXMbM
|
||||
|
||||

|
||||
|
||||
## Preparation
|
||||
|
||||
* [Equip the microservo with crocodile clips](/device/servo)
|
||||
|
||||
## Activities
|
||||
|
||||
* [Servo](/projects/inchworm/servo)
|
||||
* [Chassis](/projects/inchworm/chassis)
|
||||
* [Make](/projects/inchworm/make)
|
||||
* [Code](/projects/inchworm/code)
|
||||
* [Connect](/projects/inchworm/connect)
|
||||
|
||||
### ~button /projects/inchworm/servo
|
||||
### ~button /projects/inchworm/make
|
||||
|
||||
Let's get started!
|
||||
|
||||
|
@ -16,10 +16,10 @@ at a certain pace. In the code below, the user pressed button ``A`` to launch th
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
pins.servoWritePin(AnalogPin.P0, 0)
|
||||
basic.pause(500)
|
||||
pins.servoWritePin(AnalogPin.P0, 180)
|
||||
basic.pause(500)
|
||||
pins.servoWritePin(AnalogPin.P0, 0);
|
||||
basic.pause(500);
|
||||
pins.servoWritePin(AnalogPin.P0, 180);
|
||||
basic.pause(500);
|
||||
});
|
||||
```
|
||||
|
||||
@ -30,19 +30,6 @@ so that the inchworm goes as fast as possible. Trying it on carpet also great he
|
||||
|
||||
### ~
|
||||
|
||||
## Step 2: radio controlled inchworm
|
||||
|
||||
You will need 2 @boardname@ for this part. By using the radio, we can make the inchworm controlled by another @boardname@.
|
||||
Download the code below to the @boardname@ on the inchworm and another "controller" @boardname@. Whenere A is pressed, the inchworm will move once.
|
||||
|
||||
```blocks
|
||||
radio.onDataPacketReceived(({receivedNumber}) => {
|
||||
pins.servoWritePin(AnalogPin.P0, 0)
|
||||
basic.pause(500)
|
||||
pins.servoWritePin(AnalogPin.P0, 180)
|
||||
basic.pause(500)
|
||||
})
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
radio.sendNumber(0)
|
||||
})
|
||||
```
|
||||
### ~button /projects/inchworm/connect
|
||||
NEXT: Connect
|
||||
### ~
|
28
docs/projects/inchworm/connect.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Connect
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
Remote control your inchworm with another @boardname@
|
||||
|
||||
### ~
|
||||
|
||||
## Duration: ~30 minutes
|
||||
|
||||
You will need 2 @boardname@ for this part. By using the radio, we can make the inchworm controlled by another @boardname@.
|
||||
Download the code below to the @boardname@ on the inchworm and another "controller" @boardname@. Whenere A is pressed, the inchworm will move once.
|
||||
|
||||
```blocks
|
||||
radio.onDataPacketReceived(({receivedNumber}) => {
|
||||
pins.servoWritePin(AnalogPin.P0, 0)
|
||||
basic.pause(500)
|
||||
pins.servoWritePin(AnalogPin.P0, 180)
|
||||
basic.pause(500)
|
||||
})
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
radio.sendNumber(0)
|
||||
})
|
||||
```
|
||||
|
||||
```package
|
||||
radio
|
||||
```
|
@ -1,4 +1,4 @@
|
||||
# Chassis
|
||||
# Make
|
||||
### @description Building the cardboard inchworm
|
||||
|
||||
### ~avatar avatar
|
@ -17,8 +17,8 @@ Build a telegraph between two @boardname@s to communicate with your friends!
|
||||
|
||||
## Activities
|
||||
|
||||
* [Making the circuit](/projects/telegraph/make)
|
||||
* [Manual telegraph](/projects/telegraph/manual-telegraph)
|
||||
* [Make](/projects/telegraph/make)
|
||||
* [Code](/projects/telegraph/code)
|
||||
|
||||
### ~button /projects/telegraph/make
|
||||
Let's get started!
|
||||
|
@ -1,4 +1,4 @@
|
||||
# telegraph - manual telegraph
|
||||
# Code
|
||||
|
||||
Let's build the code that will send a impulse while the user presses ``A``.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# telegraph - making
|
||||
# Make
|
||||
|
||||
### ~avatar
|
||||
|
||||
@ -68,8 +68,8 @@ Using the 4th crocodile clip, connect the unattached end of the crocodile clip o
|
||||

|
||||
|
||||
|
||||
### ~button /projects/telegraph/manual-telegraph
|
||||
### ~button /projects/telegraph/code
|
||||
|
||||
NEXT: manual telegraph
|
||||
NEXT: Code
|
||||
|
||||
### ~
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Wallet - Code
|
||||
# Code
|
||||
|
||||
## Simple animation
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Wallet - Make
|
||||
# Make
|
||||
|
||||
### @description Maker Project for Wallet
|
||||
|
||||
|
@ -25,7 +25,7 @@ bluetooth.advertiseUidBuffer(pins.createBuffer(16), 7, true);
|
||||
|
||||
* ``buffer`` - a 16 bytes buffer containing the namespace (first 10 bytes) and instance (last 6 bytes).
|
||||
* ``power`` - a [number](/reference/types/number) representing the power level between 0 (short) and 7 (maximum range).
|
||||
* ``connectable`` - a [boolean](/reference/type/boolean) indicating whether or not the micro:bit should accept connections.
|
||||
* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections.
|
||||
|
||||
|
||||
## See Also
|
||||
|
@ -26,7 +26,7 @@ bluetooth.advertiseUid(42, 1, 7, true);
|
||||
* ``namespace`` last 4 bytes of the namespace uid (6 to 9)
|
||||
* ``instance`` last 4 bytes of the instance (2 to 5)
|
||||
* ``power`` - a [number](/reference/types/number) representing the power level between 0 (short) and 7 (maximum range).
|
||||
* ``connectable`` - a [boolean](/reference/type/boolean) indicating whether or not the micro:bit should accept connections.
|
||||
* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections.
|
||||
|
||||
## Encoding
|
||||
|
||||
|
@ -25,7 +25,7 @@ bluetooth.advertiseUrl("https://pxt.microbit.org/", 7, true);
|
||||
|
||||
* ``url`` - a [string](/reference/types/string) containing the URL to broadcast, at most 17 characters long, excluding the protocol (eg: ``https://``) which gets encoded as 1 byte.
|
||||
* ``power`` - a [number](/reference/types/number) representing the power level between 0 (short) and 7 (maximum range).
|
||||
* ``connectable`` - a [boolean](/reference/type/boolean) indicating whether or not the micro:bit should accept connections.
|
||||
* ``connectable`` - a [boolean](/blocks/logic/boolean) indicating whether or not the @boardname@ should accept connections.
|
||||
|
||||
### Example: Broadcast a secret code
|
||||
|
||||
|
30
docs/reference/pins/set-events.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Set Events
|
||||
|
||||
Configure the type of events emitted by a given pin.
|
||||
|
||||
```sig
|
||||
pins.setEvents(DigitalPin.P0, PinEventType.Edge);
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* ``name``: The @boardname@ hardware pin to configure (``P0`` through ``P20``)
|
||||
* ``type``: The type of events this pin should emit
|
||||
|
||||
### Example
|
||||
|
||||
The following example configures pin ``P0`` and then
|
||||
subscribes to the rise and fall events.
|
||||
|
||||
```blocks
|
||||
control.onEvent(control.eventSourceId(EventBusSource.MICROBIT_ID_IO_P0), control.eventValueId(EventBusValue.MICROBIT_PIN_EVT_RISE), () => {
|
||||
basic.showString("Rise")
|
||||
})
|
||||
control.onEvent(control.eventSourceId(EventBusSource.MICROBIT_ID_IO_P0), control.eventValueId(EventBusValue.MICROBIT_PIN_EVT_FALL), () => {
|
||||
basic.showString("Fall")
|
||||
})
|
||||
pins.setEvents(DigitalPin.P0, PinEventType.Edge)
|
||||
```
|
||||
|
||||
**This is an advanced API.** For more information, see the
|
||||
[@boardname@ runtime messageBus documentation](https://lancaster-university.github.io/microbit-docs/ubit/messageBus/)
|
@ -21,7 +21,7 @@ To add or remove the parts of the packet from the block, try clicking the blue g
|
||||
* `receivedString` - The [string](/reference/types/string) that was sent in this packet or the empty string if this packet did not contain a string. See [send string](/reference/radio/send-string) and [send value](/reference/radio/send-value)
|
||||
* `time` - The system time of the @boardname@ that sent this packet at the time the packet was sent.
|
||||
* `serial` - The serial number of the @boardname@ that sent this packet or `0` if the @boardname@ did not include its serial number.
|
||||
* `signal` - How strong the radio signal is from `255` (weak) to `0` (strong).
|
||||
* `signal` - How strong the radio signal is from `-128` (weak) to `-42` (strong).
|
||||
|
||||
### Example
|
||||
|
||||
@ -39,6 +39,23 @@ radio.onDataPacketReceived(({ receivedNumber }) => {
|
||||
})
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
This program uses the signal strength from received packets to graph the
|
||||
approximate distance between two @boardname@s.
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
radio.sendNumber(0)
|
||||
})
|
||||
radio.onDataPacketReceived(({ signal, receivedNumber }) => {
|
||||
led.plotBarGraph(
|
||||
Math.abs(signal + 42),
|
||||
128 - 42
|
||||
)
|
||||
})
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[send number](/reference/radio/send-number),
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
> Note: This API has been deprecated! Use [on data packet received](/reference/radio/on-data-packet-received) instead.
|
||||
|
||||
Find how strong the ``radio`` signal is, from `255` to `0`.
|
||||
(`255` means a weak signal and `0` means a strong one.)
|
||||
Find how strong the ``radio`` signal is, from `-128` to `-42`.
|
||||
(`-128` means a weak signal and `-42` means a strong one.)
|
||||
|
||||
The @boardname@ finds the signal strength by checking how strong it was
|
||||
the last time it ran the
|
||||
@ -16,7 +16,7 @@ radio.receivedSignalStrength();
|
||||
|
||||
### Returns
|
||||
|
||||
* a [number](/reference/types/number) between `255` and `0` that means
|
||||
* a [number](/reference/types/number) between `-128` and `-42` that means
|
||||
how strong the signal is.
|
||||
|
||||
### Simulator
|
||||
|
@ -7,8 +7,11 @@ serial.writeLine("");
|
||||
serial.writeNumber(0);
|
||||
serial.writeValue("x", 0);
|
||||
serial.writeString("");
|
||||
serial.readUntil(",");
|
||||
serial.readLine();
|
||||
serial.readString();
|
||||
serial.redirect(SerialPin.P0, SerialPin.P0, BaudRate.BaudRate115200);
|
||||
serial.onDataReceived(",", () => {})
|
||||
```
|
||||
|
||||
### See Also
|
||||
|
29
docs/reference/serial/on-data-received.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Serial On Data Received
|
||||
|
||||
Registers an event to be fired when one of the delimiter is matched.
|
||||
|
||||
|
||||
```sig
|
||||
serial.onDataReceived(",", () => {})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
* `delimiters` is a [string](/reference/types/string) containing any of the character to match
|
||||
|
||||
### Example
|
||||
|
||||
Read values separated by `,`:
|
||||
|
||||
```blocks
|
||||
serial.onDataReceived(serial.delimiters(Delimiters.Comma), () => {
|
||||
basic.showString(serial.readUntil(serial.delimiters(Delimiters.Comma)))
|
||||
})
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[serial](/device/serial),
|
||||
[serial write line](/reference/serial/write-line),
|
||||
[serial write value](/reference/serial/write-value)
|
||||
|
27
docs/reference/serial/read-string.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Serial Read String
|
||||
|
||||
Read the buffered serial data as a string
|
||||
|
||||
```sig
|
||||
serial.readString();
|
||||
```
|
||||
|
||||
### Returns
|
||||
|
||||
* a [string](/reference/types/string) containing input from the serial port. Empty if no data available.
|
||||
|
||||
### Example
|
||||
|
||||
The following program scrolls text on the screen as it arrives from serial.
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showString(serial.readString());
|
||||
});
|
||||
```
|
||||
|
||||
### See also
|
||||
|
||||
[serial](/device/serial),
|
||||
[serial write line](/reference/serial/write-line),
|
||||
[serial write value](/reference/serial/write-value)
|
61
docs/static/avatar.svg
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<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"
|
||||
role="img"
|
||||
aria-labelledby="title desc"
|
||||
xml:space="preserve"
|
||||
enable-background="new 0 0 280 32.755"
|
||||
height="52.672001"
|
||||
width="52.672001"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="logo.square.black.svg"><sodipodi:namedview
|
||||
pagecolor="#ff00ff"
|
||||
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="namedview14"
|
||||
showgrid="false"
|
||||
inkscape:zoom="2.0836233"
|
||||
inkscape:cx="83.390493"
|
||||
inkscape:cy="16.071144"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" /><rect
|
||||
id="backgroundrect"
|
||||
width="195.47368"
|
||||
height="34.210526"
|
||||
x="0"
|
||||
y="18.461473"
|
||||
class=""
|
||||
style="fill:none;stroke:none" /><title
|
||||
id="title"
|
||||
lang="en-GB">BBC micro:bit</title><desc
|
||||
id="desc"
|
||||
lang="en-GB">BBC micro:bit logo</desc><metadata
|
||||
id="metadata37"><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 /></cc:work></rdf:rdf><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>BBC micro:bit</dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs35" /><path
|
||||
inkscape:connector-curvature="0"
|
||||
class=""
|
||||
d="m 37.363,29.377 c -1.677,0 -3.035,-1.364 -3.035,-3.042 0,-1.678 1.357,-3.038 3.035,-3.038 1.684,0 3.039,1.36 3.039,3.038 0,1.678 -1.355,3.042 -3.039,3.042 M 15.052,23.3 c -1.677,0 -3.042,1.357 -3.042,3.035 0,1.678 1.363,3.042 3.042,3.042 1.674,0 3.036,-1.364 3.036,-3.042 0,-1.678 -1.363,-3.035 -3.036,-3.035 m -0.003,-5.99 22.576,0 c 4.979,0 9.027,4.047 9.027,9.027 0,4.979 -4.049,9.031 -9.027,9.031 l -22.576,0 c -4.977,0 -9.0299993,-4.053 -9.0299993,-9.031 C 6.0180007,21.357 10.072,17.31 15.049,17.31 m 22.576,24.076 c 8.299,0 15.047,-6.75 15.047,-15.049 0,-8.299 -6.748,-15.051 -15.047,-15.051 l -22.576,0 C 6.7500007,11.286 6.9250488e-7,18.038 6.9250488e-7,26.337 6.9250488e-7,34.636 6.7500007,41.386 15.049,41.386 l 22.576,0"
|
||||
id="path21"
|
||||
style="fill:#000000"
|
||||
sodipodi:nodetypes="csssccsssccsssscccsssssc" /></svg>
|
After Width: | Height: | Size: 2.8 KiB |
BIN
docs/static/blocks/iconnames/heart.PNG
vendored
Normal file
After Width: | Height: | Size: 5.0 KiB |
61
docs/static/loader.svg
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<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"
|
||||
role="img"
|
||||
aria-labelledby="title desc"
|
||||
xml:space="preserve"
|
||||
enable-background="new 0 0 280 32.755"
|
||||
height="52.672001"
|
||||
width="52.672001"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="logo.square.white.svg"><sodipodi:namedview
|
||||
pagecolor="#ff00ff"
|
||||
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="namedview14"
|
||||
showgrid="false"
|
||||
inkscape:zoom="2.0836233"
|
||||
inkscape:cx="83.390493"
|
||||
inkscape:cy="16.071144"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" /><rect
|
||||
id="backgroundrect"
|
||||
width="195.47368"
|
||||
height="34.210526"
|
||||
x="0"
|
||||
y="18.461473"
|
||||
class=""
|
||||
style="fill:none;stroke:none" /><title
|
||||
id="title"
|
||||
lang="en-GB">BBC micro:bit</title><desc
|
||||
id="desc"
|
||||
lang="en-GB">BBC micro:bit logo</desc><metadata
|
||||
id="metadata37"><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 /></cc:work></rdf:rdf><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>BBC micro:bit</dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs35" /><path
|
||||
inkscape:connector-curvature="0"
|
||||
class=""
|
||||
d="m 37.363,29.377 c -1.677,0 -3.035,-1.364 -3.035,-3.042 0,-1.678 1.357,-3.038 3.035,-3.038 1.684,0 3.039,1.36 3.039,3.038 0,1.678 -1.355,3.042 -3.039,3.042 M 15.052,23.3 c -1.677,0 -3.042,1.357 -3.042,3.035 0,1.678 1.363,3.042 3.042,3.042 1.674,0 3.036,-1.364 3.036,-3.042 0,-1.678 -1.363,-3.035 -3.036,-3.035 m -0.003,-5.99 22.576,0 c 4.979,0 9.027,4.047 9.027,9.027 0,4.979 -4.049,9.031 -9.027,9.031 l -22.576,0 c -4.977,0 -9.0299993,-4.053 -9.0299993,-9.031 C 6.0180007,21.357 10.072,17.31 15.049,17.31 m 22.576,24.076 c 8.299,0 15.047,-6.75 15.047,-15.049 0,-8.299 -6.748,-15.051 -15.047,-15.051 l -22.576,0 C 6.7500007,11.286 6.9250488e-7,18.038 6.9250488e-7,26.337 6.9250488e-7,34.636 6.7500007,41.386 15.049,41.386 l 22.576,0"
|
||||
id="path21"
|
||||
style="fill:#ffffff"
|
||||
sodipodi:nodetypes="csssccsssccsssscccsssssc" /></svg>
|
After Width: | Height: | Size: 2.8 KiB |
3
docs/static/logo.square.black.svg
vendored
@ -11,8 +11,7 @@
|
||||
aria-labelledby="title desc"
|
||||
xml:space="preserve"
|
||||
enable-background="new 0 0 280 32.755"
|
||||
height="52.672001"
|
||||
width="52.672001"
|
||||
viewBox="0 0 52.672001 52.672001"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
3
docs/static/logo.square.white.svg
vendored
@ -11,8 +11,7 @@
|
||||
aria-labelledby="title desc"
|
||||
xml:space="preserve"
|
||||
enable-background="new 0 0 280 32.755"
|
||||
height="52.672001"
|
||||
width="52.672001"
|
||||
viewBox="0 0 52.672001 52.672001"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
74
docs/tutorials/getting-started.md
Normal file
@ -0,0 +1,74 @@
|
||||
# Getting started
|
||||
|
||||
### Step 1
|
||||
|
||||
Place blocks in the workspace to scroll text on the screen.
|
||||
|
||||
```blocks
|
||||
basic.showString("Hello!")
|
||||
```
|
||||
|
||||
### Step 2
|
||||
|
||||
Click ``|Download|`` to transfer your code in your @boardname@!
|
||||
|
||||
### Step 3
|
||||
|
||||
Great, the text scrolled! But then it stopped.
|
||||
Let's make it scroll when button **A** is pressed.
|
||||
|
||||
```block
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
basic.showString("Hello!")
|
||||
});
|
||||
```
|
||||
|
||||
### Step 4
|
||||
|
||||
Click ``|Download|`` to transfer your code
|
||||
and press **A** to scroll your text.
|
||||
|
||||
### Step 5
|
||||
|
||||
Place more blocks to display a smiley when button **B** is pressed.
|
||||
Use the dropdown to find ``B``!
|
||||
|
||||
```block
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
basic.showLeds(`
|
||||
# # . # #
|
||||
# # . # #
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .
|
||||
`)
|
||||
})
|
||||
```
|
||||
|
||||
### Step 6
|
||||
|
||||
Drag more blocks to display a frownie when @boardname@ is shaken.
|
||||
|
||||
```block
|
||||
input.onGesture(Gesture.Shake, () => {
|
||||
basic.showLeds(`
|
||||
# # . # #
|
||||
# # . # #
|
||||
. . . . .
|
||||
. # # # .
|
||||
# . . . #
|
||||
`)
|
||||
})
|
||||
```
|
||||
|
||||
### Step 7
|
||||
|
||||
Drag more blocks to display a random number when pin ``P0`` is touched.
|
||||
Hold your right thumb on the ``GND`` metal pin
|
||||
at press the ``0`` pin with your right hand to trigger this event.
|
||||
|
||||
```block
|
||||
input.onPinPressed(TouchPin.P0, () => {
|
||||
basic.showNumber(Math.random(7))
|
||||
})
|
||||
```
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"versions": {
|
||||
"0": {
|
||||
"latest": "v0.6.45",
|
||||
"latest": "v0.7.41",
|
||||
"banned": [],
|
||||
"prompt": "v0.0.0"
|
||||
"prompt": "v0.7.41"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
<xml xmlns="http://www.w3.org/1999/xhtml">
|
||||
<block type="pxt-on-start"></block>
|
||||
<block type="device_forever"></block>
|
||||
</xml>
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"bluetooth.onBluetoothConnected|param|body": "Code, der ausgeführt wird, wenn eine Bluetooth-Verbindung aufgebaut wurde",
|
||||
"bluetooth.uartWriteNumber": "Gibt einen numerischen Wert an die serielle",
|
||||
"bluetooth.uartWriteValue": "Schreibt ein ``Namen: Wert`` Wertepaar auf die serielle Schnittstelle.",
|
||||
"bluetooth.uartWriteValue|param|name": "Name des Wertestreams, z.B.: x",
|
||||
|
21
libs/bluetooth/_locales/no/bluetooth-strings.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"bluetooth.advertiseUid|block": "bluetooth kringkast UID|namespace (bytes 6-9)%ns|instance (bytes 2-6)%instance|med sendereffekt %power|kan tilkobles %connectable",
|
||||
"bluetooth.advertiseUrl|block": "bluetooth kringkast url %url|med sendereffekt %power|kan tilkobles %connectable",
|
||||
"bluetooth.onBluetoothConnected|block": "når bluetooth tilkobles",
|
||||
"bluetooth.onBluetoothDisconnected|block": "når bluetooth frakobles",
|
||||
"bluetooth.setTransmitPower|block": "bluetooth sett sendereffekt %power",
|
||||
"bluetooth.startAccelerometerService|block": "bluetooth akselerometer-tjeneste",
|
||||
"bluetooth.startButtonService|block": "bluetooth trykknapp-tjeneste",
|
||||
"bluetooth.startIOPinService|block": "bluetooth digital tilkobling-tjeneste",
|
||||
"bluetooth.startLEDService|block": "bluetooth LED-tjeneste",
|
||||
"bluetooth.startMagnetometerService|block": "bluetooth magnetometer-tjeneste",
|
||||
"bluetooth.startTemperatureService|block": "bluetooth temperatur-tjeneste",
|
||||
"bluetooth.startUartService|block": "bluetooth serieport-tjeneste (UART)",
|
||||
"bluetooth.stopAdvertising|block": "bluetooth stopp kringkasting",
|
||||
"bluetooth.uartReadUntil|block": "bluetooth serieport|les frem til %del=serial_delimiter_conv",
|
||||
"bluetooth.uartWriteNumber|block": "bluetooth serieport|skriv tall %value",
|
||||
"bluetooth.uartWriteString|block": "bluetooth serieport|skriv tekst %data",
|
||||
"bluetooth.uartWriteValue|block": "bluetooth serieport|skriv verdi %name|= %value",
|
||||
"bluetooth|block": "bluetooth",
|
||||
"{id:category}Bluetooth": "Bluetooth"
|
||||
}
|
@ -7,7 +7,7 @@ using namespace pxt;
|
||||
/**
|
||||
* Support for additional Bluetooth services.
|
||||
*/
|
||||
//% color=#0082FB weight=20 icon="\uf294"
|
||||
//% color=#0082FB weight=96 icon="\uf294"
|
||||
namespace bluetooth {
|
||||
MicroBitUARTService *uart = NULL;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Support for additional Bluetooth services.
|
||||
*/
|
||||
//% color=#0082FB weight=20 icon="\uf294"
|
||||
//% color=#0082FB weight=96 icon="\uf294"
|
||||
namespace bluetooth {
|
||||
/**
|
||||
* Writes to the Bluetooth UART service buffer. From there the data is transmitted over Bluetooth to a connected device.
|
||||
|
@ -6,7 +6,9 @@
|
||||
"enums.d.ts",
|
||||
"shims.d.ts",
|
||||
"bluetooth.ts",
|
||||
"bluetooth.cpp"
|
||||
"bluetooth.cpp",
|
||||
"_locales/de/bluetooth-jsdoc-strings.json",
|
||||
"_locales/no/bluetooth-strings.json"
|
||||
],
|
||||
"public": true,
|
||||
"dependencies": {
|
||||
@ -46,7 +48,7 @@
|
||||
"microbit-dal": {
|
||||
"bluetooth": {
|
||||
"open": 1,
|
||||
"pairing_mode": 0,
|
||||
"pairing_mode": 0,
|
||||
"whitelist": 0,
|
||||
"security_level": null
|
||||
}
|
||||
|
2
libs/bluetooth/shims.d.ts
vendored
@ -4,7 +4,7 @@
|
||||
/**
|
||||
* Support for additional Bluetooth services.
|
||||
*/
|
||||
//% color=#0082FB weight=20 icon="\uf294"
|
||||
//% color=#0082FB weight=96 icon="\uf294"
|
||||
declare namespace bluetooth {
|
||||
|
||||
/**
|
||||
|
@ -36,6 +36,7 @@
|
||||
"basic.showAnimation": "Shows a sequence of LED screens as an animation.",
|
||||
"basic.showAnimation|param|interval": "time in milliseconds between each redraw",
|
||||
"basic.showAnimation|param|leds": "pattern of LEDs to turn on/off",
|
||||
"basic.showIcon": "Draws the selected icon on the LED screen",
|
||||
"basic.showLeds": "Draws an image on the LED screen.",
|
||||
"basic.showLeds|param|interval": "time in milliseconds to pause after drawing",
|
||||
"basic.showLeds|param|leds": "the pattern of LED to turn on/off",
|
||||
@ -223,6 +224,9 @@
|
||||
"pins.servoWritePin": "Writes a value to the servo, controlling the shaft accordingly. On a standard servo, this will set the angle of the shaft (in degrees), moving the shaft to that orientation. On a continuous rotation servo, this will set the speed of the servo (with ``0`` being full-speed in one direction, ``180`` being full speed in the other, and a value near ``90`` being no movement).",
|
||||
"pins.servoWritePin|param|name": "pin to write to, eg: AnalogPin.P0",
|
||||
"pins.servoWritePin|param|value": "angle or rotation speed, eg:180,90,0",
|
||||
"pins.setEvents": "Configures the events emitted by this pin. Events can be subscribed to\nusing ``control.onEvent()``.",
|
||||
"pins.setEvents|param|name": "pin to set the event mode on, eg: DigitalPin.P0",
|
||||
"pins.setEvents|param|type": "the type of events for this pin to emit, eg: PinEventType.Edge",
|
||||
"pins.setPull": "Configures the pull of this pin.",
|
||||
"pins.setPull|param|name": "pin to set the pull mode on, eg: DigitalPin.P0",
|
||||
"pins.setPull|param|pull": "one of the mbed pull configurations, eg: PinPullMode.PullUp",
|
||||
@ -231,8 +235,10 @@
|
||||
"pins.spiWrite|param|value": "Data to be sent to the SPI slave",
|
||||
"serial": "Reading and writing data over a serial connection.",
|
||||
"serial.delimiters": "Returns the delimiter corresponding string",
|
||||
"serial.onLineReceived": "Registers an event to be fired when a line has been received",
|
||||
"serial.onDataReceived": "Registers an event to be fired when one of the delimiter is matched.",
|
||||
"serial.onDataReceived|param|delimiters": "the characters to match received characters against.",
|
||||
"serial.readLine": "Reads a line of text from the serial port.",
|
||||
"serial.readString": "Reads the buffered received data as a string",
|
||||
"serial.readUntil": "Reads a line of text from the serial port and returns the buffer when the delimiter is met.",
|
||||
"serial.readUntil|param|delimiter": "text delimiter that separates each text chunk",
|
||||
"serial.redirect": "Dynamically configuring the serial instance to use pins other than USBTX and USBRX.",
|
||||
|
@ -7,6 +7,19 @@
|
||||
"AcceleratorRange.OneG|block": "1g",
|
||||
"AcceleratorRange.TwoG": "The accelerator measures forces up to 2 gravity",
|
||||
"AcceleratorRange.TwoG|block": "2g",
|
||||
"AnalogPin.P11|block": "P11 (write only)",
|
||||
"AnalogPin.P12|block": "P12 (write only)",
|
||||
"AnalogPin.P13|block": "P13 (write only)",
|
||||
"AnalogPin.P14|block": "P14 (write only)",
|
||||
"AnalogPin.P15|block": "P15 (write only)",
|
||||
"AnalogPin.P16|block": "P16 (write only)",
|
||||
"AnalogPin.P19|block": "P19 (write only)",
|
||||
"AnalogPin.P20|block": "P20 (write only)",
|
||||
"AnalogPin.P5|block": "P5 (write only)",
|
||||
"AnalogPin.P6|block": "P6 (write only)",
|
||||
"AnalogPin.P7|block": "P5 (write only)",
|
||||
"AnalogPin.P8|block": "P8 (write only)",
|
||||
"AnalogPin.P9|block": "P9 (write only)",
|
||||
"BaudRate.BaudRate115200|block": "115200",
|
||||
"BaudRate.BaudRate9600|block": "9600",
|
||||
"BeatFraction.Breve|block": "4",
|
||||
@ -55,6 +68,46 @@
|
||||
"Gesture.TiltLeft|block": "tilt left",
|
||||
"Gesture.TiltRight": "Raised when the screen is pointing right",
|
||||
"Gesture.TiltRight|block": "tilt right",
|
||||
"IconNames.Angry|block": "angry",
|
||||
"IconNames.Asleep|block": "asleep",
|
||||
"IconNames.Butterfly|block": "butterfly",
|
||||
"IconNames.Chessboard|block": "chess board",
|
||||
"IconNames.Confused|block": "confused",
|
||||
"IconNames.Cow|block": "cow",
|
||||
"IconNames.Diamond|block": "diamond",
|
||||
"IconNames.Duck|block": "duck",
|
||||
"IconNames.EigthNote|block": "eigth note",
|
||||
"IconNames.Fabulous|block": "fabulous",
|
||||
"IconNames.Ghost|block": "ghost",
|
||||
"IconNames.Giraffe|block": "giraffe",
|
||||
"IconNames.Happy|block": "happy",
|
||||
"IconNames.Heart|block": "heart",
|
||||
"IconNames.House|block": "house",
|
||||
"IconNames.LeftTriangle|block": "left triangle",
|
||||
"IconNames.Meh|block": "meh",
|
||||
"IconNames.No|block": "no",
|
||||
"IconNames.Pacman|block": "pac man",
|
||||
"IconNames.Pitchfork|block": "pitchfork",
|
||||
"IconNames.QuarterNote|block": "quarter note",
|
||||
"IconNames.Rabbit|block": "rabbit",
|
||||
"IconNames.Rollerskate|block": "roller skate",
|
||||
"IconNames.Sad|block": "sad",
|
||||
"IconNames.Silly|block": "silly",
|
||||
"IconNames.Skull|block": "skull",
|
||||
"IconNames.SmallDiamond|block": "small diamond",
|
||||
"IconNames.SmallHeart|block": "small heart",
|
||||
"IconNames.SmallSquare|block": "small square",
|
||||
"IconNames.Snake|block": "snake",
|
||||
"IconNames.Square|block": "square",
|
||||
"IconNames.StickFigure|block": "stick figure",
|
||||
"IconNames.Surprised|block": "surprised",
|
||||
"IconNames.Sword|block": "sword",
|
||||
"IconNames.TShirt|block": "t-shirt",
|
||||
"IconNames.Target|block": "target",
|
||||
"IconNames.Tortoise|block": "tortoise",
|
||||
"IconNames.Triangle|block": "triangle",
|
||||
"IconNames.Umbrella|block": "umbrella",
|
||||
"IconNames.Yes|block": "yes",
|
||||
"LedSpriteProperty.Blink|block": "blink",
|
||||
"LedSpriteProperty.Brightness|block": "brightness",
|
||||
"LedSpriteProperty.Direction|block": "direction",
|
||||
@ -74,6 +127,10 @@
|
||||
"Note.GSharp4|block": "G#4",
|
||||
"Note.GSharp5|block": "G#5",
|
||||
"Note.GSharp|block": "G#",
|
||||
"PinEventType.Edge|block": "edge",
|
||||
"PinEventType.None|block": "none",
|
||||
"PinEventType.Pulse|block": "pulse",
|
||||
"PinEventType.Touch|block": "touch",
|
||||
"PinPullMode.PullDown|block": "down",
|
||||
"PinPullMode.PullNone|block": "none",
|
||||
"PinPullMode.PullUp|block": "up",
|
||||
@ -81,17 +138,16 @@
|
||||
"PulseValue.Low|block": "low",
|
||||
"Rotation.Pitch|block": "pitch",
|
||||
"Rotation.Roll|block": "roll",
|
||||
"String.charAt|block": "char from %this|at %pos",
|
||||
"String.compare|block": "compare %this| to %that",
|
||||
"String.concat|block": "join %this|%other",
|
||||
"String.charAt|block": "char from %this=text|at %pos",
|
||||
"String.compare|block": "compare %this=text| to %that",
|
||||
"String.fromCharCode|block": "text from char code %code",
|
||||
"String.isEmpty|block": "%this| is empty",
|
||||
"String.length|block": "length of %VALUE",
|
||||
"String.substr|block": "substring of %this|from %start|of length %length",
|
||||
"String.substr|block": "substring of %this=text|from %start|of length %length",
|
||||
"String|block": "String",
|
||||
"basic.clearScreen|block": "clear screen",
|
||||
"basic.forever|block": "forever",
|
||||
"basic.pause|block": "pause (ms) %pause",
|
||||
"basic.showIcon|block": "show icon %i",
|
||||
"basic.showLeds|block": "show leds",
|
||||
"basic.showNumber|block": "show|number %number",
|
||||
"basic.showString|block": "show|string %text",
|
||||
@ -167,11 +223,14 @@
|
||||
"pins.pulseIn|block": "pulse in (µs)|pin %name|pulsed %value",
|
||||
"pins.servoSetPulse|block": "servo set pulse|pin %value|to (µs) %micros",
|
||||
"pins.servoWritePin|block": "servo write|pin %name|to %value",
|
||||
"pins.setEvents|block": "set pin %pin|to emit %type|events",
|
||||
"pins.setPull|block": "set pull|pin %pin|to %pull",
|
||||
"pins.spiWrite|block": "spi write %value",
|
||||
"pins|block": "pins",
|
||||
"serial.delimiters|block": "%del",
|
||||
"serial.onDataReceived|block": "serial|on data received %delimiters=serial_delimiter_conv",
|
||||
"serial.readLine|block": "serial|read line",
|
||||
"serial.readString|block": "serial|read string",
|
||||
"serial.readUntil|block": "serial|read until %delimiter=serial_delimiter_conv",
|
||||
"serial.redirect|block": "serial|redirect to|TX %tx|RX %rx|at baud rate %rate",
|
||||
"serial.writeLine|block": "serial|write line %text",
|
||||
|
@ -47,6 +47,7 @@
|
||||
"control": "Laufzeit- und Event-Dienstprogramme.",
|
||||
"control.assert": "Wenn die Bedingung falsch ist, zeige eine Nachricht auf der seriellen Konsole und gebe Panic-Code 098 aus",
|
||||
"control.deviceName": "Erzeugt einen Namen für das Gerät, basierend auf der Seriennummer",
|
||||
"control.deviceSerialNumber": "Leite eine einzigartige, einheitliche Seriennummer dieses Gerätes aus den internen Daten ab.",
|
||||
"control.eventSourceId": "Gibt den Wert einer C++-Laufzeitkonstanten aus",
|
||||
"control.eventTimestamp": "Holt den Zeitstempel des letzten Events auf dem Bus",
|
||||
"control.eventValue": "Holt den Wert des letzten ausgeführten Events auf dem Bus",
|
||||
@ -64,7 +65,6 @@
|
||||
"control.waitMicros|param|micros": "Anzahl der Mikrosekunden, die gewartet werden soll, z.B.: 4",
|
||||
"game": "Eine Einzel-LED-Sprite-Spielumgebung",
|
||||
"game.addLife": "Fügt Leben zum aktuellen Spielstand hinzu",
|
||||
"game.addLife|param|lives": "TODO",
|
||||
"game.addScore": "Fügt zum aktuellen Spielstand Punkte hinzu",
|
||||
"game.addScore|param|points": "Anzahl von zu verändernden Punkten, z.B.: 1",
|
||||
"game.createSprite": "Erzeugt einen neuen LED-Sprite, der nach rechts zeigt.",
|
||||
@ -79,12 +79,9 @@
|
||||
"game.levelUp": "Erhöht das Level und zeigt eine Nachricht an.",
|
||||
"game.life": "Ruft das aktuelle Leben ab",
|
||||
"game.removeLife": "Entfernt ein Leben",
|
||||
"game.removeLife|param|life": "TODO",
|
||||
"game.score": "Ruft den aktuellen Punktestand ab",
|
||||
"game.setLife": "Setzt den aktuellen Wert der Leben",
|
||||
"game.setLife|param|value": "TODO",
|
||||
"game.setScore": "Setzt den aktuellen Wert des Spielstands",
|
||||
"game.setScore|param|value": "TODO",
|
||||
"game.showScore": "Zeigt den Spielstand auf dem Display.",
|
||||
"game.startCountdown": "Startet einen Spiel-Countdown",
|
||||
"game.startCountdown|param|ms": "Countdown-Dauer in Millisekunden, z.B.: 10000",
|
||||
@ -94,38 +91,24 @@
|
||||
"images.createImage": "Erstellt ein Bild, das auf den LED-Bildschirm passt.",
|
||||
"input": "Ereignisse und Daten der Sensoren",
|
||||
"input.acceleration": "Holt den Beschleunigungswert in Milli-Erdanziehung (wenn das Board flach mit dem Display nach oben liegt, X = 0, y = 0 und Z =-1024)",
|
||||
"input.acceleration|param|dimension": "TODO",
|
||||
"input.buttonIsPressed": "Erhalte den Sie den Tastenstatus (gepresst oder nicht) für ``A`` und ``B``.",
|
||||
"input.calibrate": "Veraltet, Kompasskalibrierung erfolgt automatisch.",
|
||||
"input.compassHeading": "Holt die aktuelle Kompassrichtung in Grad.",
|
||||
"input.lightLevel": "Liest die Lichtintensität auf dem LED-Bildschirm im Bereich von ``0`` (dunkel) und `` 255`` (hell).",
|
||||
"input.magneticForce": "Ruft den Wert der Magnetkraft in ``Mikro-Tesla`` (``µT``) ab. Diese Funktion wird im Simulator nicht unterstützt.",
|
||||
"input.magneticForce|param|dimension": "TODO",
|
||||
"input.onButtonPressed": "Tue etwas, wenn eine Taste (``A``, ``B`` oder ``A + B``) gedrückt wird",
|
||||
"input.onButtonPressed|param|body": "TODO",
|
||||
"input.onButtonPressed|param|button": "TODO",
|
||||
"input.onGesture": "Mache etwas, wenn eine Geste gemacht wird (wie den mini zu schütteln).",
|
||||
"input.onGesture|param|body": "TODO",
|
||||
"input.onLogoDown": "Fügt Code hinzu, der ausgeführt wird, wenn das Logo nach unten zeigt und das Board vertikal ausgerichtet ist.",
|
||||
"input.onLogoDown|param|body": "TODO",
|
||||
"input.onLogoUp": "Fügt Code hinzu, der ausgeführt wird, wenn das Logo nach oben zeigt und das Board vertikal ausgerichtet ist.",
|
||||
"input.onLogoUp|param|body": "TODO",
|
||||
"input.onPinPressed": "Mache etwas, wenn eine Pin gehalten wird.",
|
||||
"input.onPinPressed|param|body": "Code, der ausführt wird, wenn ein Pin gehalten wird",
|
||||
"input.onPinPressed|param|name": "Der Pin, der gehalten werden muss",
|
||||
"input.onPinReleased": "Mache etwas, wenn der Pin losgelassen wird.",
|
||||
"input.onPinReleased|param|body": "Code, der ausgeführt werden soll, wenn der Pin losgelassen wird",
|
||||
"input.onPinReleased|param|name": "Der Pin, der losgelassen werden muss",
|
||||
"input.onScreenDown": "Hängt Code an, der ausgeführt wird, wenn der Bildschirm nach unten zeigt.",
|
||||
"input.onScreenDown|param|body": "TODO",
|
||||
"input.onScreenUp": "Hängt Code an, der ausgeführt wird, wenn der Bildschirm nach oben zeigt.",
|
||||
"input.onScreenUp|param|body": "TODO",
|
||||
"input.onShake": "Hängt Code an, der ausgeführt wird, wenn der mini geschüttelt wird.",
|
||||
"input.onShake|param|body": "TODO",
|
||||
"input.pinIsPressed": "Ruft den Pin-Zustand (gehalten oder nicht) ab. Die Erdung muss gehalten werden, um den Stromkreis zu schließen.",
|
||||
"input.pinIsPressed|param|name": "Pin, der verwendet wird, um eine Berührung zu erkennen",
|
||||
"input.rotation": "Die Neigung und Drehung des mini Drehung auf ``X-Achse``oder ``Y-Achse``, in Grad.",
|
||||
"input.rotation|param|kind": "TODO",
|
||||
"input.runningTime": "Ruft die Anzahl der Millisekunden auf, die seit dem Einschalten vergangen sind.",
|
||||
"input.setAccelerometerRange": "Legt die Stichprobenbereich des Beschleunigungssensors in Schwerkraft fest.",
|
||||
"input.setAccelerometerRange|param|range": "Ein Wert, der die maximale Stärke der gemessenen Beschleunigung beschreibt",
|
||||
@ -134,19 +117,13 @@
|
||||
"led.brightness": "Ruft die Helligkeit des Bildschirms ab, von 0 (aus) bis 255 (volle Helligkeit).",
|
||||
"led.enable": "Schaltet das Display an und aus",
|
||||
"led.fadeIn": "Blendet die Bildschirmanzeige ein.",
|
||||
"led.fadeIn|param|ms": "TODO",
|
||||
"led.fadeOut": "Blendet die Bildschirmhelligkeit aus.",
|
||||
"led.fadeOut|param|ms": "TODO",
|
||||
"led.plot": "Schalte die angegebene LED mit Hilfe von X- und Y-Koordinaten ein (X ist horizontal, Y ist vertikal). (0,0) ist die obere linke Ecke.",
|
||||
"led.plotAll": "Schaltet alle LEDs an",
|
||||
"led.plotBarGraph": "Zeigt ein vertikales Balkendiagramm an, basierend auf dem `Wert`und dem `Hoch`-Wert. Wenn `Hoch`0 ist, wird das Diagramm automatisch angepasst.",
|
||||
"led.plotBarGraph|param|high": "maximalen Wert. Wenn dieser 0 ist, wird der Maximalwert automatisch angepasst, z.B.: 0",
|
||||
"led.plotBarGraph|param|value": "aktueller Wert zum Darstellen",
|
||||
"led.plot|param|x": "TODO",
|
||||
"led.plot|param|y": "TODO",
|
||||
"led.point": "Ruft den An/Aus-Status einer vorgegebenen LED mittels X-/Y-Koordinaten ab. (0,0) ist oben links.",
|
||||
"led.point|param|x": "TODO",
|
||||
"led.point|param|y": "TODO",
|
||||
"led.screenshot": "Macht einen Screenshot vom LED-Bildschirm und gibt ein Bild aus.",
|
||||
"led.setBrightness": "Lege die Helligkeit des Bildschirms fest, von 0 (aus) bis 255 (volle Helligkeit).",
|
||||
"led.setBrightness|param|value": "Helligkeitswert, z.B.: 255, 127, 0",
|
||||
@ -155,17 +132,12 @@
|
||||
"led.stopAnimation": "Bricht die aktuelle Animation ab und löscht andere ausstehende Animationen.",
|
||||
"led.toggle": "Schaltet ein bestimmtes Pixel ein",
|
||||
"led.toggleAll": "Invertiert die aktuelle LED-Anzeige",
|
||||
"led.toggle|param|x": "TODO",
|
||||
"led.toggle|param|y": "TODO",
|
||||
"led.unplot": "Schalte die angegebene LED mit x-und y-Koordinaten ab (X ist horizontal, y ist vertikal). (0,0) ist oben links.",
|
||||
"led.unplot|param|x": "TODO",
|
||||
"led.unplot|param|y": "TODO",
|
||||
"music": "Generierung von von Musik durch Pin ``P0``.",
|
||||
"music.beat": "Gibt die Dauer eines Taktes in Milli-Sekunden aus",
|
||||
"music.changeTempoBy": "Ändere die Geschwindigkeit um den angegebenen Betrag",
|
||||
"music.changeTempoBy|param|bpm": "Die Änderung in Schlägen pro Minute auf das Tempo, z.B.: 20",
|
||||
"music.noteFrequency": "Ruft die Frequenz einer Note ab.",
|
||||
"music.noteFrequency|param|name": "der Name der Notiz",
|
||||
"music.playTone": "Spielt einen Ton für den angegebenen Zeitraum über Pin ``P0`` ab.",
|
||||
"music.playTone|param|frequency": "Tonhöhe des abzuspielenden Tones in Hertz (Hz)",
|
||||
"music.playTone|param|ms": "Tondauer in Millisekunden (ms)",
|
||||
@ -181,21 +153,15 @@
|
||||
"pins.analogPitch|param|frequency": "TODO",
|
||||
"pins.analogPitch|param|ms": "TODO",
|
||||
"pins.analogReadPin": "Lese den Anschlusswert als Analog aus, d. h. als einen Wert zwischen 0 und 1023.",
|
||||
"pins.analogReadPin|param|name": "Pin, auf den geschrieben werden soll",
|
||||
"pins.analogSetPeriod": "Stellt die Pulsweite Modulation (PWM) des Analogausganges auf den angegebenen Wert in ** Mikrosekunden ** oder `1/1000` Millisekunden ein.\nWenn dieser Pin nicht als einen Analogausgang (mit `analog write pin`) konfiguriert ist, hat der Vorgang keine Auswirkungen.",
|
||||
"pins.analogSetPeriod|param|micros": "Zeit in Mikrosekunden. z.B.: 20000",
|
||||
"pins.analogSetPeriod|param|name": "analoger Pin, der zeitlich festgelegt werden soll",
|
||||
"pins.analogSetPitchPin": "Setzt den genutzten Pin, wenn `pins->analog pitch`angewendet wird.",
|
||||
"pins.analogSetPitchPin|param|name": "TODO",
|
||||
"pins.analogWritePin": "Legt den Wert des Verbinders auf analog fest. Der Wert muss zwischen 0 und 1023 liegen.",
|
||||
"pins.analogWritePin|param|name": "PIN-Name, auf den geschrieben werden soll",
|
||||
"pins.analogWritePin|param|value": "Wert, der auf den Pin geschrieben werden soll, zwischen ``0`` und ``1023`` z.B.: 1023,0",
|
||||
"pins.createBuffer": "Erstellt einen Null-initialisierten Zwischenspeicher.",
|
||||
"pins.createBuffer|param|size": "Anzahl der Bytes im Zwischenspeicher",
|
||||
"pins.digitalReadPin": "Lese den angegebene Pin oder Verbinder als 0 oder 1",
|
||||
"pins.digitalReadPin|param|name": "Pin, aus dem gelesen werden soll",
|
||||
"pins.digitalWritePin": "Setzt einen Pin- oder Verbinder-Wert auf 0 oder 1.",
|
||||
"pins.digitalWritePin|param|name": "Pin, auf den geschrieben werden soll",
|
||||
"pins.digitalWritePin|param|value": "Wert, der auf dem Pin 1 gesetzt werden soll, z.B. 0",
|
||||
"pins.i2cReadBuffer": "Lese `Größe`bytes aus einer 7-bit I2C-Adresse.",
|
||||
"pins.i2cReadNumber": "Lese eine Nummer aus einer 7-bit I2C-Adresse.",
|
||||
@ -210,29 +176,21 @@
|
||||
"pins.onPulsed": "Stellt diesen Pin als einen Digitaleingang ein und generiert Ereignisse, deren Zeitstempel die Dauer darstellt, in der der Pin entweder ``hoch``oder ``niedrig``war.",
|
||||
"pins.pulseDuration": "Ruft die Dauer des letzten Impulses in Mikrosendungen ab. Diese Funktion soll von einem `onPulsed`-Handler aufgerufen werden.",
|
||||
"pins.pulseIn": "Gibt die Dauer eines Pulses in Mikrosekunden an",
|
||||
"pins.pulseIn|param|name": "der Pin, der den Puls misst",
|
||||
"pins.pulseIn|param|value": "der Wert des Pulses (Standard hoch)",
|
||||
"pins.servoSetPulse": "Konfiguriert diesen IO-Pin als einen analogen/PWM-Ausgang, stellt den Zeitraum auf 20 ms ein und setzt die Pulsweite fest, basieren auf dem angegeben Wert **Mikrosekunden** oder `1/1000`Millisekunden.",
|
||||
"pins.servoSetPulse|param|micros": "Impulsdauer in Mikrosekunden, z.B.: 1500",
|
||||
"pins.servoSetPulse|param|name": "PIN-Name",
|
||||
"pins.servoWritePin": "Schreibt einen Wert in den Servo, der die Welle entsprechend kontroliert. Auf einem Standard-Servo wird so der Winkel der Welle (in Grad) eingestellt, sodass sich die Welle entsprechend anpasst. Auf einem kontinuierlich drehenden Servo wird dadurch die Geschwindigkeit des Servos festgelegt, wobei ``0``die volle Geschwindigkeit in eine Richtung darstellt, ``180``die volle Geschwindigkeit in die andere, und ein Wert von ``90`` einen Stillstand erzeugt.",
|
||||
"pins.servoWritePin|param|name": "Pin, auf den geschrieben werden soll",
|
||||
"pins.servoWritePin|param|value": "Winkel oder Rotationsbeschleunigung, z.B.: 180,90,0",
|
||||
"pins.setPull": "Stellt die Anziehungskraft des Pins ein.",
|
||||
"pins.setPull|param|name": "Pin, auf dem der Pull-Modus aktiviert wird",
|
||||
"pins.setPull|param|pull": "eine der mbed-Pull-Konfigurationen: PullUp, PullDown, PullNone",
|
||||
"pins.sizeOf": "Ruft die Bytegröße im spezifierten Nummernformat ab.",
|
||||
"pins.spiWrite": "Schreibe in den SPI-Slave und gebe die Antwort aus",
|
||||
"pins.spiWrite|param|value": "Daten, die an den SPI-Slave geschickt werden sollen",
|
||||
"serial": "Lesen und Schreiben von Daten über eine serielle Verbindung.",
|
||||
"serial.delimiters": "Gibt die mit dem Begrenzer korrespondierende Zeichenfolge aus.",
|
||||
"serial.onLineReceived": "Registriert ein Event, das ausgeführt wird, wenn eine Zeile empfangen wurde",
|
||||
"serial.readLine": "Liest eine Textzeile aus der seriellen Schnittstelle.",
|
||||
"serial.readUntil": "Liest aus eine Textzeile aus dem seriellen Anschluss und gibt den Puffer aus, wenn die Begrenzung erreicht wurde.",
|
||||
"serial.readUntil|param|delimiter": "Text-Begrenzung, die die Textblöcke voneinander trennt",
|
||||
"serial.redirect": "Konfiguriert dynamisch die serielle Instanz, damit sie andere Pins als USBTX und USBRX benutzt.",
|
||||
"serial.redirect|param|rx": "der neue Empfangs-Pin",
|
||||
"serial.redirect|param|tx": "Der neue Übertragungs-Pin",
|
||||
"serial.writeLine": "Gibt eine Zeile des Textes an die serielle",
|
||||
"serial.writeNumber": "Gibt einen numerischen Wert an die serielle",
|
||||
"serial.writeString": "Sendet ein Stück Text über serielle Verbindung.",
|
||||
|
@ -7,26 +7,80 @@
|
||||
"AcceleratorRange.OneG|block": "1g",
|
||||
"AcceleratorRange.TwoG": "Der Bewegungssensor misst Kräfte bis 2g",
|
||||
"AcceleratorRange.TwoG|block": "2g",
|
||||
"BaudRate.BaudRate115200|block": "115200",
|
||||
"BaudRate.BaudRate9600|block": "9600",
|
||||
"BeatFraction.Eighth|block": "1/8",
|
||||
"BeatFraction.Half|block": "1/2",
|
||||
"BeatFraction.Quarter|block": "1/4",
|
||||
"BeatFraction.Sixteenth|block": "1/16",
|
||||
"BeatFraction.Whole|block": "1",
|
||||
"Button.AB|block": "A+B",
|
||||
"Delimiters.Dollar|block": "$",
|
||||
"Delimiters.Hash|block": "#",
|
||||
"Delimiters.NewLine|block": "Neue Zeile",
|
||||
"Dimension.Strength|block": "Stärke",
|
||||
"Dimension.X|block": "x",
|
||||
"Dimension.Y|block": "y",
|
||||
"Dimension.Z|block": "z",
|
||||
"Direction.Left|block": "links",
|
||||
"Direction.Right|block": "rechts",
|
||||
"DisplayMode.BackAndWhite|block": "Schwarz-Weiß",
|
||||
"DisplayMode.Greyscale|block": "Graustufen",
|
||||
"EventCreationMode.CreateAndFire": "Calliope mini-Event wurde initialisiert, seine Event-Handler werden unverzüglich ausgeführt (nicht geeignet für die Nutzung bei Unterbrechungen!).",
|
||||
"EventCreationMode.CreateOnly": "Calliope mini-Event wurde initialisiert, es wird keine weitere Verarbeitung vorgenommen.",
|
||||
"Gesture.EightG|block": "8g",
|
||||
"Gesture.FreeFall": "Wird ausgeführt, wenn das Board fällt!",
|
||||
"Gesture.FreeFall|block": "freier Fall",
|
||||
"Gesture.LogoDown": "Wird ausgeführt, wenn das Logo nach unten zeigt und das Display vertikal ist.",
|
||||
"Gesture.LogoDown|block": "Logo nach unten",
|
||||
"Gesture.LogoUp": "Wird ausgeführt, wenn das Logo nach oben zeigt und das Display vertikal ist.",
|
||||
"Gesture.LogoUp|block": "Logo oben",
|
||||
"Gesture.ScreenDown": "Wird ausgeführt, wenn das Display nach oben zeigt und das Board horizontal ist.",
|
||||
"Gesture.ScreenDown|block": "Display nach unten",
|
||||
"Gesture.ScreenUp": "Wird ausgeführt, wenn das Display nach unten zeigt und das Board horizontal ist.",
|
||||
"Gesture.ScreenUp|block": "Display nach oben",
|
||||
"Gesture.Shake": "Wird erhöht, wenn geschüttelt",
|
||||
"Gesture.Shake|block": "geschüttelt",
|
||||
"Gesture.SixG": "Wird ausgeführt, ein 6g starker Stoß erkannt wird",
|
||||
"Gesture.SixG|block": "6g",
|
||||
"Gesture.ThreeG": "Wird ausgeführt, ein 3g starker Stoß erkannt wird",
|
||||
"Gesture.ThreeG|block": "3g",
|
||||
"Gesture.TiltLeft": "Wird ausgeführt, wenn das Display nach links zeigt",
|
||||
"Gesture.TiltLeft|block": "nach links neigen",
|
||||
"Gesture.TiltRight": "Wird ausgeführt, wenn das Display nach rechts zeigt",
|
||||
"Gesture.TiltRight|block": "nach rechts neigen",
|
||||
"LedSpriteProperty.Blink|block": "blinken",
|
||||
"LedSpriteProperty.Brightness|block": "Helligkeit",
|
||||
"LedSpriteProperty.Direction|block": "Richtung",
|
||||
"LedSpriteProperty.X|block": "x",
|
||||
"LedSpriteProperty.Y|block": "y",
|
||||
"Math.randomBoolean|block": "wähle zufälligen Wahr- oder Falsch-Wert",
|
||||
"Math|block": "Mathematik",
|
||||
"Note.CSharp3|block": "C#3",
|
||||
"Note.CSharp4|block": "C#4",
|
||||
"Note.CSharp5|block": "C#5",
|
||||
"Note.CSharp|block": "C#",
|
||||
"Note.FSharp3|block": "F#3",
|
||||
"Note.FSharp4|block": "F#4",
|
||||
"Note.FSharp5|block": "F#5",
|
||||
"Note.FSharp|block": "F#",
|
||||
"Note.GSharp3|block": "G#3",
|
||||
"Note.GSharp4|block": "G#4",
|
||||
"Note.GSharp5|block": "G#5",
|
||||
"Note.GSharp|block": "G#",
|
||||
"PinPullMode.PullDown|block": "nach unten",
|
||||
"PinPullMode.PullUp|block": "nach oben",
|
||||
"Rotation.Pitch|block": "Winkel",
|
||||
"String.charAt|block": "Zeichen an Position %pos aus|%this",
|
||||
"String.compare|block": "vergleiche %this| mit %that",
|
||||
"String.concat|block": "hänge %this| mit %other aneinander",
|
||||
"Rotation.Roll|block": "rollen",
|
||||
"String.fromCharCode|block": "Text aus char code %code",
|
||||
"String.isEmpty|block": "%this| ist leer",
|
||||
"String.length|block": "Länge von %VALUE",
|
||||
"String.substr|block": "extrahiere aus %this|beginnend mit %start|%length Zeichen",
|
||||
"String|block": "Zeichenfolge",
|
||||
"basic.clearScreen|block": "Bildschirminhalt löschen",
|
||||
"basic.forever|block": "dauerhaft",
|
||||
"basic.pause|block": "Pausiere (ms) %pause",
|
||||
"basic.pause|block": "pausiere (ms) %pause",
|
||||
"basic.showLeds|block": "zeige LEDs",
|
||||
"basic.showNumber|block": "zeige|Nummer %number",
|
||||
"basic.showString|block": "Zeige|Zeichenfolge %text",
|
||||
"basic.showString|block": "zeige|Zeichenfolge %text",
|
||||
"basic|block": "Grundlagen",
|
||||
"control.deviceName|block": "Gerätename",
|
||||
"control.deviceSerialNumber|block": "Seriennnummer",
|
||||
@ -56,7 +110,7 @@
|
||||
"input.magneticForce|block": "Magnetkraft (µT) |%NAME",
|
||||
"input.onButtonPressed|block": "wenn Knopf|%NAME|gedrückt",
|
||||
"input.onGesture|block": "wenn |%NAME",
|
||||
"input.onPinPressed|block": "wenn Pin %NAME|gedrückt",
|
||||
"input.onPinPressed|block": "wenn Pin|%NAME|gedrückt",
|
||||
"input.onPinReleased|block": "wenn Pin %NAME|losgelassen",
|
||||
"input.pinIsPressed|block": "Pin %NAME|ist gedrückt",
|
||||
"input.rotation|block": "Rotation (°)|%NAME",
|
||||
@ -71,7 +125,7 @@
|
||||
"led.setBrightness|block": "Setze Helligkeit auf %value",
|
||||
"led.stopAnimation|block": "Halte Animation an",
|
||||
"led.toggle|block": "Schalte zwischen|x %x|y %y",
|
||||
"led.unplot|block": "Unplot|x %x|y %y",
|
||||
"led.unplot|block": "schalte Pixel|x %x|y %y aus",
|
||||
"led|block": "LED",
|
||||
"music.beat|block": "%fraction|Takt",
|
||||
"music.changeTempoBy|block": "ändere die Geschwindigkeit (bpm)|%value",
|
||||
@ -99,13 +153,13 @@
|
||||
"pins.spiWrite|block": "schreibe %value in SPI",
|
||||
"pins|block": "Pins",
|
||||
"serial.delimiters|block": "%del",
|
||||
"serial.readLine|block": "serial|read line",
|
||||
"serial.readUntil|block": "serial|read until %delimiter=serial_delimiter_conv",
|
||||
"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.readLine|block": "seriell|Zeile lesen",
|
||||
"serial.readUntil|block": "seriell|lesen bis %delimiter=serial_delimiter_conv",
|
||||
"serial.redirect|block": "seriell|umleiten auf|TX %tx|RX %rx|mit Baudrate %rate",
|
||||
"serial.writeLine|block": "seriell|Zeile ausgeben %text",
|
||||
"serial.writeNumber|block": "seriell|Zahl ausgeben %value",
|
||||
"serial.writeString|block": "seriell|Zeichenkette ausgeben %text",
|
||||
"serial.writeValue|block": "serial|Wert ausgeben %name|= %value",
|
||||
"serial|block": "seriell",
|
||||
"{id:category}Basic": "Grundlagen",
|
||||
"{id:category}Control": "Steuerung",
|
||||
|
@ -21,59 +21,40 @@
|
||||
"basic.showString|param|text": "le texte à faire défiler sur l’écran, par exemple : « Bonjour ! »",
|
||||
"control.inBackground": "Planifie le code qui s’exécute en arrière-plan.",
|
||||
"control.reset": "Réinitialise le micro:bit de BBC.",
|
||||
"control.waitMicros": "Bloque la fibre courante pour le nombre de microsecondes donné",
|
||||
"control.waitMicros|param|micros": "nombre de microsecondes à attendre. par ex. : 4",
|
||||
"game": "Un moteur de jeu avec une unique LED",
|
||||
"game.addLife|param|lives": "TODO",
|
||||
"game.addScore": "Ajoute des points au score actuel",
|
||||
"game.addScore|param|points": "nombre de points à changer, par ex. : 1",
|
||||
"game.gameOver": "Affiche un animation de fin de jeu.",
|
||||
"game.removeLife|param|life": "TODO",
|
||||
"game.score": "Obtient le score actuel",
|
||||
"game.setLife|param|value": "TODO",
|
||||
"game.setScore": "Définit la valeur du score actuel",
|
||||
"game.setScore|param|value": "TODO",
|
||||
"game.startCountdown": "Démarre un compte à rebours de jeu",
|
||||
"game.startCountdown|param|ms": "durée du compte à rebours en millisecondes, par ex. : 10000",
|
||||
"images": "Création, manipulation et affichage d’images LED.",
|
||||
"images.createBigImage": "Crée une image à partir de 2 images.",
|
||||
"images.createImage": "Crée une image qui s’adapte aux dimensions de l’écran LED.",
|
||||
"input": "Événements et des données provenant de capteurs",
|
||||
"input.acceleration|param|dimension": "TODO",
|
||||
"input.acceleration": "Donne la valeur de l'accélération en milli-g (quand la carte est à plat avec l'écran vers le haut, x=0, y=0 et z=-1024)",
|
||||
"input.buttonIsPressed": "Donne l'état du bouton (appuyé ou non) pour ``A`` et ``B``.",
|
||||
"input.calibrate": "Obsolète, le calibrage de la boussole est automatique.",
|
||||
"input.compassHeading": "Obtient la direction actuelle du compas en degrés.",
|
||||
"input.magneticForce|param|dimension": "TODO",
|
||||
"input.onButtonPressed|param|body": "TODO",
|
||||
"input.onButtonPressed|param|button": "TODO",
|
||||
"input.onGesture|param|body": "TODO",
|
||||
"input.onLogoDown|param|body": "TODO",
|
||||
"input.onLogoUp|param|body": "TODO",
|
||||
"input.lightLevel": "Lit le niveau de lumière appliqué à l'écran LED de ``0`` (sombre) à ``255`` lumineux.",
|
||||
"input.magneticForce": "Obtenir la valeur de la force magnétique en ``micro-Teslas`` (``µT``). Cette fonction n’est pas supportée par le simulateur.",
|
||||
"input.onButtonPressed": "Faire quelque chose quand un bouton (``A``, ``B`` ou les deux ``A+B``) est appuyé",
|
||||
"input.onGesture": "Faire quelque chose lorsque lorsqu’un geste est fait (par exemple secouer le micro:bit).",
|
||||
"input.onPinPressed": "Faire quelque chose lorsque vous appuyez sur une broche.",
|
||||
"input.onPinPressed|param|body": "code à exécuter lorsque la broche est enfoncée",
|
||||
"input.onPinPressed|param|name": "la broche qui doit être pressée",
|
||||
"input.onPinReleased": "Faire quelque chose quand une broche est relâchée.",
|
||||
"input.onPinReleased|param|body": "le code à exécuter lorsque la broche est relâchée",
|
||||
"input.onPinReleased|param|name": "la broche qui doit être relâchée",
|
||||
"input.onScreenDown|param|body": "TODO",
|
||||
"input.onScreenUp|param|body": "TODO",
|
||||
"input.onShake|param|body": "TODO",
|
||||
"input.pinIsPressed|param|name": "broche utilisée pour détecter le contact",
|
||||
"input.rotation|param|kind": "TODO",
|
||||
"input.pinIsPressed": "Donne l’état de la broche (pressée ou non). Nécessite de tenir la masse pour fermer le circuit.",
|
||||
"input.runningTime": "Donne le nombre de millisecondes écoulées depuis la mise en route.",
|
||||
"input.temperature": "Obtient la température en degrés Celsius (°C).",
|
||||
"led": "Contrôle de l’écran LED.",
|
||||
"led.enable": "Active ou désactive l’affichage",
|
||||
"led.fadeIn|param|ms": "TODO",
|
||||
"led.fadeOut|param|ms": "TODO",
|
||||
"led.plotAll": "Allume toutes les LEDS",
|
||||
"led.plotBarGraph|param|value": "valeur actuelle à tracer",
|
||||
"led.plot|param|x": "TODO",
|
||||
"led.plot|param|y": "TODO",
|
||||
"led.point|param|x": "TODO",
|
||||
"led.point|param|y": "TODO",
|
||||
"led.setBrightness|param|value": "valeur de la luminosité, par ex. : 255, 127, 0",
|
||||
"led.toggle|param|x": "TODO",
|
||||
"led.toggle|param|y": "TODO",
|
||||
"led.unplot|param|x": "TODO",
|
||||
"led.unplot|param|y": "TODO",
|
||||
"music.rest": "Repose (joue rien) pendant une durée spécifiée via broche '' P0''.",
|
||||
"pins.analogPitch|param|frequency": "TODO",
|
||||
"pins.analogPitch|param|ms": "TODO",
|
||||
|
@ -30,7 +30,6 @@
|
||||
"input.magneticForce|block": "force magnétique (µT) |%NAME",
|
||||
"input.onButtonPressed|block": "lorsque le button|%NAME|est pressé",
|
||||
"input.onGesture|block": "lorsque|%NAME",
|
||||
"input.onPinPressed|block": "lorsque le pin %NAME|est pressé",
|
||||
"input.onPinReleased|block": "lorsque la broche %NAME|est lachée",
|
||||
"input.pinIsPressed|block": "broche %NAME| est pressée",
|
||||
"input.rotation|block": "rotation (°)|%NAME",
|
||||
|
155
libs/core/_locales/ja/core-strings.json
Normal file
@ -0,0 +1,155 @@
|
||||
{
|
||||
"AcceleratorRange.EightG": "8Gまでの加速度を測ります。",
|
||||
"AcceleratorRange.EightG|block": "8G",
|
||||
"AcceleratorRange.FourG": "4Gまでの加速度を測ります。",
|
||||
"AcceleratorRange.FourG|block": "4G",
|
||||
"AcceleratorRange.OneG": "1Gまでの加速度を測ります。",
|
||||
"AcceleratorRange.OneG|block": "1G",
|
||||
"AcceleratorRange.TwoG": "2Gまでの加速度を測ります。",
|
||||
"AcceleratorRange.TwoG|block": "2G",
|
||||
"BaudRate.BaudRate115200|block": "115200",
|
||||
"BaudRate.BaudRate9600|block": "9600",
|
||||
"BeatFraction.Breve|block": "4",
|
||||
"BeatFraction.Double|block": "2",
|
||||
"BeatFraction.Eighth|block": "1/8",
|
||||
"BeatFraction.Half|block": "1/2",
|
||||
"BeatFraction.Quarter|block": "1/4",
|
||||
"BeatFraction.Sixteenth|block": "1/16",
|
||||
"BeatFraction.Whole|block": "1",
|
||||
"Button.AB|block": "A+B",
|
||||
"Delimiters.Dollar|block": "$",
|
||||
"Delimiters.Hash|block": "#",
|
||||
"Delimiters.NewLine|block": "改行",
|
||||
"Dimension.X|block": "X",
|
||||
"Dimension.Y|block": "Y",
|
||||
"Dimension.Z|block": "Z",
|
||||
"Direction.Left|block": "左",
|
||||
"Direction.Right|block": "右",
|
||||
"DisplayMode.BackAndWhite|block": "白黒",
|
||||
"DisplayMode.Greyscale|block": "グレースケール",
|
||||
"Gesture.EightG": "8Gの衝撃があったときに発生します。",
|
||||
"Gesture.EightG|block": "8G",
|
||||
"Gesture.FreeFall": "ボードを落としたときに発生します。",
|
||||
"Gesture.FreeFall|block": "落とした",
|
||||
"Gesture.LogoDown": "画面が垂直で、ロゴの位置が下になったときに発生します。",
|
||||
"Gesture.LogoDown|block": "ロゴが下になった",
|
||||
"Gesture.LogoUp": "画面が垂直で、ロゴの位置が上になったときに発生します。",
|
||||
"Gesture.LogoUp|block": "ロゴが上になった",
|
||||
"Gesture.ScreenDown": "ボードが水平で、画面が下向きになったときに発生します。",
|
||||
"Gesture.ScreenDown|block": "画面が下になった",
|
||||
"Gesture.ScreenUp": "ボードが水平で、画面が上向きになったときに発生します。",
|
||||
"Gesture.ScreenUp|block": "画面が上になった",
|
||||
"Gesture.Shake": "ボードがゆさぶられたときに発生します。",
|
||||
"Gesture.Shake|block": "ゆさぶられた",
|
||||
"Gesture.SixG": "6Gの衝撃があったときに発生します。",
|
||||
"Gesture.SixG|block": "6G",
|
||||
"Gesture.ThreeG": "3Gの衝撃があったときに発生します。",
|
||||
"Gesture.ThreeG|block": "3G",
|
||||
"Gesture.TiltLeft": "画面を左に傾けたときに発生します。",
|
||||
"Gesture.TiltLeft|block": "左に傾けた",
|
||||
"Gesture.TiltRight": "画面を右に傾けたときに発生します。",
|
||||
"Gesture.TiltRight|block": "右に傾けた",
|
||||
"IconNames.Angry|block": "おこり顔",
|
||||
"IconNames.Asleep|block": "ねてる顔",
|
||||
"IconNames.Butterfly|block": "ちょうちょ",
|
||||
"IconNames.Chessboard|block": "チェス盤",
|
||||
"IconNames.Confused|block": "こまり顔",
|
||||
"IconNames.Cow|block": "うし",
|
||||
"IconNames.Diamond|block": "ダイアモンド",
|
||||
"IconNames.Duck|block": "あひる",
|
||||
"IconNames.EigthNote|block": "8分音符",
|
||||
"IconNames.Ghost|block": "おばけ",
|
||||
"IconNames.Giraffe|block": "きりん",
|
||||
"IconNames.Happy|block": "うれしい顔",
|
||||
"IconNames.Heart|block": "ハート",
|
||||
"IconNames.House|block": "家",
|
||||
"IconNames.Pacman|block": "パックマン",
|
||||
"IconNames.Pitchfork|block": "くまで",
|
||||
"IconNames.QuarterNote|block": "4分音符",
|
||||
"IconNames.Rabbit|block": "うさぎ",
|
||||
"IconNames.Rollerskate|block": "ローラースケート",
|
||||
"IconNames.Sad|block": "かなしい顔",
|
||||
"IconNames.Silly|block": "へん顔",
|
||||
"IconNames.Skull|block": "がいこつ",
|
||||
"IconNames.SmallDiamond|block": "小さいダイアモンド",
|
||||
"IconNames.SmallHeart|block": "小さいハート",
|
||||
"IconNames.SmallSquare|block": "小さいしかく",
|
||||
"IconNames.Snake|block": "へび",
|
||||
"IconNames.Square|block": "しかく",
|
||||
"IconNames.Surprised|block": "びっくり顔",
|
||||
"IconNames.TShirt|block": "Tシャツ",
|
||||
"IconNames.Target|block": "まと",
|
||||
"IconNames.Tortoise|block": "かめ",
|
||||
"IconNames.Triangle|block": "さんかく",
|
||||
"IconNames.Umbrella|block": "かさ",
|
||||
"LedSpriteProperty.Blink|block": "点滅",
|
||||
"LedSpriteProperty.Brightness|block": "明るさ",
|
||||
"LedSpriteProperty.Direction|block": "方向",
|
||||
"LedSpriteProperty.X|block": "X",
|
||||
"LedSpriteProperty.Y|block": "Y",
|
||||
"Math.randomBoolean|block": "真または偽をランダムに選ぶ",
|
||||
"Math|block": "計算",
|
||||
"Note.CSharp3|block": "C#3",
|
||||
"Note.CSharp4|block": "C#4",
|
||||
"Note.CSharp5|block": "C#5",
|
||||
"Note.CSharp|block": "C#",
|
||||
"Note.FSharp3|block": "F#3",
|
||||
"Note.FSharp4|block": "F#4",
|
||||
"Note.FSharp5|block": "F#5",
|
||||
"Note.FSharp|block": "F#",
|
||||
"Note.GSharp3|block": "G#3",
|
||||
"Note.GSharp4|block": "G#4",
|
||||
"Note.GSharp5|block": "G#5",
|
||||
"Note.GSharp|block": "G#",
|
||||
"PinPullMode.PullDown|block": "プルダウン",
|
||||
"PinPullMode.PullUp|block": "プルアップ",
|
||||
"String.fromCharCode|block": "文字コード %code|の文字",
|
||||
"basic.clearScreen|block": "表示を消す",
|
||||
"basic.forever|block": "ずっと",
|
||||
"basic.pause|block": "ひと休み(ミリ秒) %pause",
|
||||
"basic.showLeds|block": "LEDに表示",
|
||||
"basic.showNumber|block": "数を表示|%number",
|
||||
"basic.showString|block": "文字列を表示|%text",
|
||||
"basic|block": "基本",
|
||||
"control.inBackground|block": "バックグラウンドで実行する",
|
||||
"control.reset|block": "リセット",
|
||||
"control.waitMicros|block": "ひと休み(マイクロ秒) %micros",
|
||||
"control|block": "制御",
|
||||
"game.gameOver|block": "ゲームオーバー",
|
||||
"game|block": "ゲーム",
|
||||
"images.createBigImage|block": "大きな画像を作成",
|
||||
"images.createImage|block": "画像を作成",
|
||||
"images|block": "画像",
|
||||
"input.acceleration|block": "加速度(ミリG)|%NAME",
|
||||
"input.compassHeading|block": "方角(°)",
|
||||
"input.lightLevel|block": "明るさ",
|
||||
"input.magneticForce|block": "磁力(µT)|%NAME",
|
||||
"input.onPinPressed|block": "端子 %name|がタッチされたとき",
|
||||
"input.onPinReleased|block": "端子 %NAME|がタッチされなくなったとき",
|
||||
"input.pinIsPressed|block": "端子 %NAME|がタッチされている",
|
||||
"input.rotation|block": "傾斜(°)|%NAME",
|
||||
"input.runningTime|block": "稼働時間(ミリ秒)",
|
||||
"input.setAccelerometerRange|block": "加速度センサの計測範囲を設定する %range",
|
||||
"input.temperature|block": "温度(℃)",
|
||||
"led.brightness|block": "明るさ",
|
||||
"led.enable|block": "表示をオンまたはオフにする %on",
|
||||
"led.plot|block": "点灯|x %x|y %y",
|
||||
"led.toggle|block": "反転|x %x|y %y",
|
||||
"led.unplot|block": "消灯|x %x|y %y",
|
||||
"led|block": "LED",
|
||||
"music.beat|block": "%fraction|拍",
|
||||
"music.changeTempoBy|block": "テンポを増減する(bpm)|%value",
|
||||
"music.setTempo|block": "テンポを設定する(bpm)|%value",
|
||||
"music.tempo|block": "テンポ(bpm)",
|
||||
"music|block": "音楽",
|
||||
"{id:category}Basic": "基本",
|
||||
"{id:category}Control": "制御",
|
||||
"{id:category}Game": "ゲーム",
|
||||
"{id:category}Images": "画像",
|
||||
"{id:category}Input": "入力",
|
||||
"{id:category}Led": "LED",
|
||||
"{id:category}Math": "計算",
|
||||
"{id:category}Music": "音楽",
|
||||
"{id:category}Pins": "入出力端子",
|
||||
"{id:category}Serial": "シリアル通信"
|
||||
}
|
49
libs/core/_locales/no/core-jsdoc-strings.json
Normal file
@ -0,0 +1,49 @@
|
||||
{
|
||||
"Math.abs": "Gir absoluttverdien av et tall (størrelsen av tallet, uavhengig av om det er positivt eller negativt).\nFor eksempel er absoluttverdien av -5 og absoluttverdien av 5 begge lik 5.",
|
||||
"Math.abs|param|x": "Et tall eller matematisk uttrykk som vi ønsker absoluttverdien av.",
|
||||
"Math.max": "Gir verdien til det største av to tall eller matematiske uttrykk.",
|
||||
"Math.randomBoolean": "Gir en tilfeldig logisk verdi, \"sann\" eller \"usann\".",
|
||||
"String.fromCharCode": "Lag en tekst som består av tegnet med den angitte ASCII-koden.",
|
||||
"basic": "Blokker for grunnleggende mikro:bit-funksjonalitet.",
|
||||
"basic.clearScreen": "Slå av alle lysene på skjermen",
|
||||
"basic.forever": "Gjentar denne koden hele tiden, i bakgrunnen. Lar annen kode kjøre etter hver gjentakelse.",
|
||||
"basic.pause": "Gjør at programmet venter en angitt tid, i millisekunder",
|
||||
"basic.pause|param|ms": "hvor lenge pausen skal vare, f.eks: 100, 200, 500, 1000, 2000",
|
||||
"basic.plotLeds": "Tegner et bilde på skjermen.",
|
||||
"basic.plotLeds|param|leds": "mønster av lysdioder som er på",
|
||||
"basic.showAnimation": "Viser en sekvens av bilder som en animasjon.",
|
||||
"basic.showAnimation|param|interval": "tid i millisekunder mellom hver gang skjermbildet tegnes",
|
||||
"basic.showAnimation|param|leds": "mønster av lysdioder som er på",
|
||||
"basic.showLeds": "Tegner et bilde på skjermen.",
|
||||
"basic.showLeds|param|interval": "pause i millisekunder etter visning",
|
||||
"basic.showLeds|param|leds": "mønsteret som skal vises med lysdiodene",
|
||||
"basic.showNumber": "Vis et tall, rullende over skjermen. Hvis tallet får plass på skjermen (dvs. er ett enkelt siffer), ruller det ikke.",
|
||||
"basic.showNumber|param|interval": "farten til det som ruller over skjermen; f.eks: 150, 100, 200, -100",
|
||||
"basic.showString": "Vis en tekst rullende over skjermen. Hvis strengen har bare ett tegn ruller den ikke.",
|
||||
"basic.showString|param|interval": "hvor fort teksten skal rulle, f.eks: 150, 100, 200, -100",
|
||||
"basic.showString|param|text": "teksten som ruller over skjermen, f.eks: \"Hallo!\"",
|
||||
"control": "Styrer programkjøring og hendelser.",
|
||||
"control.inBackground": "Setter opp kode som skal kjøre i bakgrunnen.",
|
||||
"control.reset": "Tilbakestiller micro:bit.",
|
||||
"game": "En spillmotor for brikker (bevegelige lyspunkter)",
|
||||
"game.addScore": "Øker poengsum med et antall poeng",
|
||||
"game.addScore|param|points": "endring i antall poeng, f.eks. 1",
|
||||
"game.gameOver": "Animasjon som viser at spillet er slutt.",
|
||||
"game.score": "Gir nåværende poengsum",
|
||||
"game.setScore": "Setter poengsum til en verdi, f.eks. 0",
|
||||
"game.startCountdown": "Starter en nedtellingsklokke",
|
||||
"game.startCountdown|param|ms": "nedtellingens varighet i millisekunder, f.eks. 10000",
|
||||
"images": "Oppretting, behandling og visning av bilder på skjermen.",
|
||||
"images.createBigImage": "Lager et bredt bilde som kan rulles over skjermen.",
|
||||
"images.createImage": "Lager et bilde.",
|
||||
"input": "Hendelser og data fra sensorer",
|
||||
"input.rotation": "Helningsvinkel til micro:bit: Rotasjon om x-aksen (høyre/venstre) og y-aksen (forover/bakover), i grader.",
|
||||
"input.runningTime": "Gir antall millisekunder siden strømmen ble slått på.",
|
||||
"input.setAccelerometerRange": "Angir måleområde og følsomhet for akselerometeret.",
|
||||
"input.setAccelerometerRange|param|range": "tallet angir den største akselerasjonen som måles",
|
||||
"input.temperature": "Gir temperaturen i grader celsius.",
|
||||
"led": "Styring av skjermen.",
|
||||
"led.brightness": "Gir skjermens lysstyrke fra 0 (av) til 255 (full styrke).",
|
||||
"led.fadeIn": "Tenner skjermen gradvis.",
|
||||
"led.fadeOut": "Slukker skjermen gradvis."
|
||||
}
|
197
libs/core/_locales/no/core-strings.json
Normal file
@ -0,0 +1,197 @@
|
||||
{
|
||||
"AcceleratorRange.EightG": "Akselerometerets måleområde er opp til 8 ganger tyngekraften",
|
||||
"AcceleratorRange.EightG|block": "8 G",
|
||||
"AcceleratorRange.FourG": "Akselerometerets måleområde er opp til 4 ganger tyngekraften",
|
||||
"AcceleratorRange.FourG|block": "4 g",
|
||||
"AcceleratorRange.OneG": "Akselerometerets måleområde er opp til 1 ganger tyngekraften",
|
||||
"AcceleratorRange.OneG|block": "1 g",
|
||||
"AcceleratorRange.TwoG": "Akselerometerets måleområde er opp til 2 ganger tyngekraften",
|
||||
"AcceleratorRange.TwoG|block": "2 g",
|
||||
"BaudRate.BaudRate115200|block": "115200",
|
||||
"BaudRate.BaudRate9600|block": "9600",
|
||||
"BeatFraction.Breve|block": "4",
|
||||
"BeatFraction.Double|block": "2",
|
||||
"BeatFraction.Eighth|block": "1/8",
|
||||
"BeatFraction.Half|block": "1/2",
|
||||
"BeatFraction.Quarter|block": "1/4",
|
||||
"BeatFraction.Sixteenth|block": "1/16",
|
||||
"BeatFraction.Whole|block": "1",
|
||||
"Button.AB|block": "A+B",
|
||||
"Delimiters.Colon|block": ":",
|
||||
"Delimiters.Comma|block": ",",
|
||||
"Delimiters.Dollar|block": "$",
|
||||
"Delimiters.Fullstop|block": ".",
|
||||
"Delimiters.Hash|block": "#",
|
||||
"Delimiters.NewLine|block": "linjeskift",
|
||||
"Dimension.Strength|block": "styrke",
|
||||
"Dimension.X|block": "x",
|
||||
"Dimension.Y|block": "y",
|
||||
"Dimension.Z|block": "z",
|
||||
"Direction.Left|block": "venstre",
|
||||
"Direction.Right|block": "høyre",
|
||||
"DisplayMode.BackAndWhite|block": "svart og hvitt",
|
||||
"DisplayMode.Greyscale|block": "gråtone",
|
||||
"Gesture.EightG": "Hendelse når et støt på over 8G detekteres",
|
||||
"Gesture.EightG|block": "8 G",
|
||||
"Gesture.FreeFall": "Hendelse når micro:bit faller!",
|
||||
"Gesture.FreeFall|block": "fritt fall",
|
||||
"Gesture.LogoDown": "Hendelse når logoen er ned og skjermen er vertikal",
|
||||
"Gesture.LogoDown|block": "logo ned",
|
||||
"Gesture.LogoUp": "Hendelse når logoen er opp og skjermen er vertikal",
|
||||
"Gesture.LogoUp|block": "logo opp",
|
||||
"Gesture.ScreenDown": "Hendelse når micro:bit ligger flatt med skjermen opp",
|
||||
"Gesture.ScreenDown|block": "skjerm ned",
|
||||
"Gesture.ScreenUp": "Hendelse når micro:bit ligger flatt med skjermen ned",
|
||||
"Gesture.ScreenUp|block": "skjerm opp",
|
||||
"Gesture.Shake": "Hendelse når micro:bit ristes",
|
||||
"Gesture.Shake|block": "ristes",
|
||||
"Gesture.SixG": "Hendelse når et støt sterkere enn 6G detekteres",
|
||||
"Gesture.SixG|block": "6G",
|
||||
"Gesture.ThreeG": "Hendelse når et støt sterkere enn 3G detekteres",
|
||||
"Gesture.ThreeG|block": "3G",
|
||||
"Gesture.TiltLeft": "Hendelse når skjermen vender mot venstre",
|
||||
"Gesture.TiltLeft|block": "helning venstre",
|
||||
"Gesture.TiltRight": "Hendelse når skjermen vender mot høyre",
|
||||
"Gesture.TiltRight|block": "helning høyre",
|
||||
"IconNames.Angry|block": "sint",
|
||||
"IconNames.Asleep|block": "sover",
|
||||
"IconNames.Butterfly|block": "sommerfugl",
|
||||
"IconNames.Chessboard|block": "sjakkbrett",
|
||||
"IconNames.Confused|block": "forvirret",
|
||||
"IconNames.Cow|block": "ku",
|
||||
"IconNames.Diamond|block": "diamant",
|
||||
"IconNames.Duck|block": "and",
|
||||
"IconNames.EigthNote|block": "8-dels note",
|
||||
"IconNames.Fabulous|block": "fantastisk",
|
||||
"IconNames.Ghost|block": "spøkelse",
|
||||
"IconNames.Giraffe|block": "giraff",
|
||||
"IconNames.Happy|block": "glad",
|
||||
"IconNames.Heart|block": "hjerte",
|
||||
"IconNames.House|block": "hus",
|
||||
"IconNames.LeftTriangle|block": "triangel venstre",
|
||||
"IconNames.Meh|block": "meh",
|
||||
"IconNames.No|block": "nei",
|
||||
"IconNames.Pacman|block": "pac man",
|
||||
"IconNames.Pitchfork|block": "gaffel",
|
||||
"IconNames.QuarterNote|block": "4-dels note",
|
||||
"IconNames.Rabbit|block": "kanin",
|
||||
"IconNames.Rollerskate|block": "rulleskøyte",
|
||||
"IconNames.Sad|block": "trist",
|
||||
"IconNames.Silly|block": "tull",
|
||||
"IconNames.Skull|block": "skalle",
|
||||
"IconNames.SmallDiamond|block": "liten diamant",
|
||||
"IconNames.SmallHeart|block": "lite hjerte",
|
||||
"IconNames.SmallSquare|block": "liten firkant",
|
||||
"IconNames.Snake|block": "slange",
|
||||
"IconNames.Square|block": "firkant",
|
||||
"IconNames.StickFigure|block": "strekmann",
|
||||
"IconNames.Surprised|block": "overrasket",
|
||||
"IconNames.Sword|block": "sverd",
|
||||
"IconNames.TShirt|block": "t-skjorte",
|
||||
"IconNames.Target|block": "blink",
|
||||
"IconNames.Tortoise|block": "skilpadde",
|
||||
"IconNames.Triangle|block": "trekant",
|
||||
"IconNames.Umbrella|block": "paraply",
|
||||
"IconNames.Yes|block": "ja",
|
||||
"LedSpriteProperty.Blink|block": "blinke",
|
||||
"LedSpriteProperty.Brightness|block": "lysstyrke",
|
||||
"LedSpriteProperty.Direction|block": "retning",
|
||||
"LedSpriteProperty.X|block": "x",
|
||||
"LedSpriteProperty.Y|block": "y",
|
||||
"Math.randomBoolean|block": "velg tilfeldig sann eller usann",
|
||||
"Math|block": "Matematikk",
|
||||
"Note.CSharp3|block": "C#3",
|
||||
"Note.CSharp4|block": "C#4",
|
||||
"Note.CSharp5|block": "C#5",
|
||||
"Note.CSharp|block": "C#",
|
||||
"Note.FSharp3|block": "F#3",
|
||||
"Note.FSharp4|block": "F#4",
|
||||
"Note.FSharp5|block": "F#5",
|
||||
"Note.FSharp|block": "F#",
|
||||
"Note.GSharp3|block": "G#3",
|
||||
"Note.GSharp4|block": "G#4",
|
||||
"Note.GSharp5|block": "G#5",
|
||||
"Note.GSharp|block": "G#",
|
||||
"PinEventType.Edge|block": "kant",
|
||||
"PinEventType.None|block": "ingen",
|
||||
"PinEventType.Pulse|block": "puls",
|
||||
"PinEventType.Touch|block": "berøring",
|
||||
"PinPullMode.PullDown|block": "lav",
|
||||
"PinPullMode.PullNone|block": "ingen",
|
||||
"PinPullMode.PullUp|block": "høy",
|
||||
"PulseValue.High|block": "høy",
|
||||
"PulseValue.Low|block": "lav",
|
||||
"String.fromCharCode|block": "tekst fra tegnverdi %code",
|
||||
"String|block": "Tekst",
|
||||
"basic.clearScreen|block": "tøm skjermen",
|
||||
"basic.forever|block": "gjenta for alltid",
|
||||
"basic.pause|block": "pause (ms) %pause",
|
||||
"basic.showIcon|block": "vis ikon %i",
|
||||
"basic.showLeds|block": "vis bilde",
|
||||
"basic.showNumber|block": "vis|tall %number",
|
||||
"basic.showString|block": "vis|tekst %text",
|
||||
"basic|block": "grunnleggende",
|
||||
"control.inBackground|block": "kjør i bakgrunnen",
|
||||
"control.reset|block": "tilbakestill",
|
||||
"control.waitMicros|block": "vent (µs) %micros",
|
||||
"control|block": "kontroll",
|
||||
"game.addScore|block": "endre poengsum med|%points",
|
||||
"game.gameOver|block": "game over",
|
||||
"game.score|block": "poengsum",
|
||||
"game.startCountdown|block": "start nedtelling|(ms) %duration",
|
||||
"game|block": "spill",
|
||||
"images.createBigImage|block": "lag stort bilde",
|
||||
"images.createImage|block": "lag bilde",
|
||||
"images|block": "bilder",
|
||||
"input.acceleration|block": "akselerasjon (mG) |%NAME",
|
||||
"input.buttonIsPressed|block": "knapp|%NAME|trykkes",
|
||||
"input.compassHeading|block": "kompassretning (°)",
|
||||
"input.lightLevel|block": "lysnivå",
|
||||
"input.magneticForce|block": "magnetfelt (µT)|%NAME",
|
||||
"input.onButtonPressed|block": "når knapp|%NAME|trykkes",
|
||||
"input.onGesture|block": "når |%NAME",
|
||||
"input.onPinPressed|block": "når kontakt %name|trykkes",
|
||||
"input.onPinReleased|block": "når kontakt %NAME|slippes",
|
||||
"input.pinIsPressed|block": "kontakt %NAME|trykkes",
|
||||
"input.rotation|block": "helningsvinkel (°)|%NAME",
|
||||
"input.runningTime|block": "kjøretid (ms)",
|
||||
"input.setAccelerometerRange|block": "sett akselerometer|maks. %range",
|
||||
"input.temperature|block": "temperatur (°C)",
|
||||
"input|block": "inngang",
|
||||
"led.brightness|block": "lysstyrke",
|
||||
"led.plotBarGraph|block": "søylediagram av %value |opp til %high",
|
||||
"led.plot|block": "tenn|x %x|y %y",
|
||||
"led.point|block": "lyser i|x %x|y %y",
|
||||
"led.setBrightness|block": "sett lysstyrke %value",
|
||||
"led.stopAnimation|block": "stopp animasjon",
|
||||
"led|block": "LED",
|
||||
"music.changeTempoBy|block": "endre tempo med (bpm)|%value",
|
||||
"music.playTone|block": "spill|tone %note=device_note|i %duration=device_beat",
|
||||
"music.rest|block": "pause (ms) |%duration = device_beat",
|
||||
"music.ringTone|block": "ring tone (Hz)|%note=device_note",
|
||||
"music.setTempo|block": "sett tempo til (bpm)|%value",
|
||||
"music|block": "musikk",
|
||||
"pins.analogReadPin|block": "les analogverdi|fra %name",
|
||||
"pins.analogSetPeriod|block": "analog sett periodetid|på %pin|til (µs) %micros",
|
||||
"pins.analogWritePin|block": "skriv analog|til %name|verdi %value",
|
||||
"pins.digitalReadPin|block": "les digitalverdi|fra %name",
|
||||
"pins.digitalWritePin|block": "skriv digital|til %name|verdi %value",
|
||||
"pins.i2cReadNumber|block": "I2C les tall|fra adresse %address|med format %format = i2c_sizeof",
|
||||
"pins.i2cWriteNumber|block": "I2C skriv tall|til adresse %address|verdi % value|med format %format = i2c_sizeof",
|
||||
"pins.map|block": "regn om %value|fra lav %fromLow|fra høy %fromHigh|til lav %toLow|til høy %toHigh",
|
||||
"pins.onPulsed|block": "når|%pin|mottar puls %pulse",
|
||||
"pins.pulseDuration|block": "pulslengde (µs)",
|
||||
"pins.servoSetPulse|block": "servo skriv pulslengde|på %value|til (µs) %micros",
|
||||
"pins.servoWritePin|block": "servo skriv|til %name|verdi %value",
|
||||
"pins.setPull|block": "sett utilkoblet verdi|for %pin|til %pull",
|
||||
"pins|block": "tilkoblinger",
|
||||
"serial.readLine|block": "serieport|les linje",
|
||||
"serial.redirect|block": "sett serieport|tilkobling|send %tx| motta %rx|med hastighet %rate",
|
||||
"serial.writeLine|block": "serieport|skriv linje %text",
|
||||
"serial.writeNumber|block": "serieport|skriv tall %value",
|
||||
"serial.writeString|block": "serieport|skriv tekst %text",
|
||||
"serial.writeValue|block": "serieport|skriv verdi %name|= %value",
|
||||
"serial|block": "føljetong",
|
||||
"{id:category}Math": "Matematikk",
|
||||
"{id:category}String": "Tekst"
|
||||
}
|
6
libs/core/_locales/si-LK/core-jsdoc-strings.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"Math.randomBoolean": "සත්යය හෝ අසත්යය අගයන් අහඹු ලෙස ලැබෙනවා. කාසියක් උඩ දාපුවම ලැබෙන අගයන් දෙක වගේ.",
|
||||
"String.fromCharCode": "දෙන ලද ASCII අක්ෂර කේතයෙන් වචනයක් සකසන්න.",
|
||||
"basic": "මුලික micro:bit අංග වලට ප්රවේශ වීමට ඉඩ කඩ ලබා දෙයි.",
|
||||
"basic.clearScreen": "සියලුම LEDs නිවා දමන්න"
|
||||
}
|
177
libs/core/_locales/si-LK/core-strings.json
Normal file
@ -0,0 +1,177 @@
|
||||
{
|
||||
"AcceleratorRange.EightG": "ත්වරකය ගුරුත්වය 8ක් වන තෙක් මිනුම් ලබා ගනියි",
|
||||
"AcceleratorRange.EightG|block": "8g",
|
||||
"AcceleratorRange.FourG": "ත්වරකය ගුරුත්වය 4ක් වන තෙක් මිනුම් ලබා ගනියි",
|
||||
"AcceleratorRange.FourG|block": "4g",
|
||||
"AcceleratorRange.OneG": "ත්වරකය ගුරුත්වය 1ක් වන තෙක් මිනුම් ලබා ගනියි",
|
||||
"AcceleratorRange.OneG|block": "1g",
|
||||
"AcceleratorRange.TwoG": "ත්වරකය ගුරුත්වය 2ක් වන තෙක් මිනුම් ලබා ගනියි",
|
||||
"AcceleratorRange.TwoG|block": "2g",
|
||||
"BaudRate.BaudRate115200|block": "115200",
|
||||
"BaudRate.BaudRate9600|block": "9600",
|
||||
"BeatFraction.Breve|block": "4",
|
||||
"BeatFraction.Double|block": "2",
|
||||
"BeatFraction.Eighth|block": "1/8",
|
||||
"BeatFraction.Half|block": "1/2",
|
||||
"BeatFraction.Quarter|block": "1/4",
|
||||
"BeatFraction.Sixteenth|block": "1/16",
|
||||
"BeatFraction.Whole|block": "1",
|
||||
"Button.AB|block": "A+B",
|
||||
"Delimiters.Dollar|block": "$",
|
||||
"Delimiters.Hash|block": "#",
|
||||
"Delimiters.NewLine|block": "නව පෙළ",
|
||||
"Dimension.Strength|block": "ප්රබලතාව",
|
||||
"Dimension.X|block": "x",
|
||||
"Dimension.Y|block": "y",
|
||||
"Dimension.Z|block": "z",
|
||||
"Direction.Left|block": "වම",
|
||||
"Direction.Right|block": "දකුණ",
|
||||
"DisplayMode.BackAndWhite|block": "කළු සහ සුදු",
|
||||
"DisplayMode.Greyscale|block": "greyscale",
|
||||
"EventCreationMode.CreateAndFire": "MicroBitEvent is initialised, and its event handlers are immediately fired (not suitable for use in interrupts!).",
|
||||
"EventCreationMode.CreateOnly": "MicroBitEvent is initialised, and no further processing takes place.",
|
||||
"Gesture.EightG": "Raised when a 8G shock is detected",
|
||||
"Gesture.EightG|block": "8g",
|
||||
"Gesture.FreeFall": "පුවරුව වැටෙන විට ඇති කරන්න!",
|
||||
"Gesture.FreeFall|block": "නිදහස් වැටීම",
|
||||
"Gesture.LogoDown": "සංකේතය යටි අතට ඇති විට සහ තිරය සිරස්ව පිහිටි විට ඇති කරන්න",
|
||||
"Gesture.LogoDown|block": "ලාංඡනය පහළට",
|
||||
"Gesture.LogoUp": "සංකේතය උඩු අතට ඇති විට සහ තිරය සිරස්ව පිහිටි විට ඇති කරන්න",
|
||||
"Gesture.LogoUp|block": "ලාංඡනය ඉහලට",
|
||||
"Gesture.ScreenDown": "තිරය ඉහලට යොමු වී ඇති විට සහ පුවරුව තිරස්ව ඇති විට ඇති කරන්න",
|
||||
"Gesture.ScreenDown|block": "තිරය පහලට",
|
||||
"Gesture.ScreenUp": "තිරය පහලට යොමු වී ඇති විට සහ පුවරුව තිරස්ව ඇති විට ඇති කරන්න",
|
||||
"Gesture.ScreenUp|block": "තිරය ඉහලට",
|
||||
"Gesture.Shake": "සෙලවුන විට ඇති කරන්න",
|
||||
"Gesture.Shake|block": "සොලවන්න",
|
||||
"Gesture.SixG": "6G කම්පනයක් අනාවරණය වූ විට ඇති කරන්න",
|
||||
"Gesture.SixG|block": "6g",
|
||||
"Gesture.ThreeG": "3G කම්පනයක් අනාවරණය වූ විට ඇති කරන්න",
|
||||
"Gesture.ThreeG|block": "3g",
|
||||
"Gesture.TiltLeft": "තිරය වමට යොමු වී ඇති විට ඇති කරන්න",
|
||||
"Gesture.TiltLeft|block": "වමට ඇල කරන්න",
|
||||
"Gesture.TiltRight": "තිරය දකුණට යොමු වී ඇති විට ඇති කරන්න",
|
||||
"Gesture.TiltRight|block": "දකුණට ඇල කරන්න",
|
||||
"LedSpriteProperty.Blink|block": "බබලනවා",
|
||||
"LedSpriteProperty.Brightness|block": "දීප්තිමත් බව",
|
||||
"LedSpriteProperty.Direction|block": "දිශාව",
|
||||
"LedSpriteProperty.X|block": "x",
|
||||
"LedSpriteProperty.Y|block": "y",
|
||||
"Math.randomBoolean|block": "අහඹු ලෙස සත්යය හෝ අසත්යය තෝරන්න",
|
||||
"Math|block": "ගණිත",
|
||||
"Note.CSharp3|block": "C#3",
|
||||
"Note.CSharp4|block": "C#4",
|
||||
"Note.CSharp5|block": "C#5",
|
||||
"Note.CSharp|block": "C#",
|
||||
"Note.FSharp3|block": "F#3",
|
||||
"Note.FSharp4|block": "F#4",
|
||||
"Note.FSharp5|block": "F#5",
|
||||
"Note.FSharp|block": "F#",
|
||||
"Note.GSharp3|block": "G#3",
|
||||
"Note.GSharp4|block": "G#4",
|
||||
"Note.GSharp5|block": "G#5",
|
||||
"Note.GSharp|block": "G#",
|
||||
"PinEventType.Edge|block": "අයින",
|
||||
"PinEventType.Pulse|block": "ස්පන්දන",
|
||||
"PinEventType.Touch|block": "ස්පර්ශ",
|
||||
"PinPullMode.PullDown|block": "පහළ",
|
||||
"PinPullMode.PullUp|block": "ඉහල",
|
||||
"PulseValue.High|block": "උසස්",
|
||||
"PulseValue.Low|block": "අඩු",
|
||||
"Rotation.Pitch|block": "pitch",
|
||||
"Rotation.Roll|block": "roll",
|
||||
"String.fromCharCode|block": "text from char code %code",
|
||||
"String|block": "String",
|
||||
"basic.clearScreen|block": "තිරය පැහැදිලි කරන්න",
|
||||
"basic.forever|block": "සදහටම",
|
||||
"basic.pause|block": "pause (ms) %pause",
|
||||
"basic.showLeds|block": "led පෙන්වන්න",
|
||||
"basic.showNumber|block": "පෙන්වන්න|අංකය %number",
|
||||
"basic.showString|block": "show|string %text",
|
||||
"basic|block": "මූලික",
|
||||
"control.inBackground|block": "පසුබිම තුල ධාවනය කරන්න",
|
||||
"control.reset|block": "යලි පිහිටුවන්න",
|
||||
"control.waitMicros|block": "wait (µs)%micros",
|
||||
"control|block": "පාලනය",
|
||||
"game.addScore|block": "change score by|%points",
|
||||
"game.gameOver|block": "ක්රීඩාව අවසන්",
|
||||
"game.score|block": "ලකුණු",
|
||||
"game.setScore|block": "ලකුණු %points සකසන්න",
|
||||
"game.startCountdown|block": "ගණනය ආරම්භ කරන්න |(ms) %duration",
|
||||
"game|block": "ක්රීඩාව",
|
||||
"images.createBigImage|block": "පින්තූර සකසන්න",
|
||||
"images.createImage|block": "පින්තූර සකසන්න",
|
||||
"images|block": "පින්තූර",
|
||||
"input.acceleration|block": "ත්වරණය (mg)|%NAME",
|
||||
"input.buttonIsPressed|block": "බොත්තම |%NAME| එබිලද",
|
||||
"input.compassHeading|block": "මාලිමා ශීර්ෂය (°)",
|
||||
"input.lightLevel|block": "ආලෝක තත්වය",
|
||||
"input.magneticForce|block": "චුම්බක බලය (µ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": "භ්රමනය (°)|%NAME",
|
||||
"input.runningTime|block": "දුවන කාලය (ms)",
|
||||
"input.setAccelerometerRange|block": "ත්වරණමානය සකසන්න |range %range",
|
||||
"input.temperature|block": "උෂ්ණත්වය (°C)",
|
||||
"input|block": "ආදානය",
|
||||
"led.brightness|block": "දීප්තිමත් බව",
|
||||
"led.enable|block": "led enable %on",
|
||||
"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": "බැබලීම සකසන්න %value",
|
||||
"led.stopAnimation|block": "සජීවීකරණ නතර කරන්න",
|
||||
"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": "තාල වේගය (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": "තාල වේගය (bpm)",
|
||||
"music|block": "සංගීතය",
|
||||
"pins.analogPitch|block": "analog pitch %frequency|for (ms) %ms",
|
||||
"pins.analogReadPin|block": "analog read|pin %name",
|
||||
"pins.analogSetPeriod|block": "analog set period|pin %pin|to (µs)%micros",
|
||||
"pins.analogSetPitchPin|block": "analog set pitch pin %name",
|
||||
"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": "ස්පන්දන පැවතුම් කාලය (µ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": "කූරු",
|
||||
"serial.onDataReceived|block": "serial|on data received %delimiters=serial_delimiter_conv",
|
||||
"serial.readLine|block": "serial|read line",
|
||||
"serial.readString|block": "serial|read string",
|
||||
"serial.readUntil|block": "serial|read until %delimiter=serial_delimiter_conv",
|
||||
"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": "අනුක්රමික",
|
||||
"{id:category}Basic": "මූලික",
|
||||
"{id:category}Control": "පාලනය",
|
||||
"{id:category}Game": "ක්රීඩාව",
|
||||
"{id:category}Images": "පින්තූර",
|
||||
"{id:category}Input": "ආදානය",
|
||||
"{id:category}Led": "Led",
|
||||
"{id:category}Math": "ගණිත",
|
||||
"{id:category}Music": "සංගීතය",
|
||||
"{id:category}Pins": "කූරු",
|
||||
"{id:category}Serial": "අනුක්රමික",
|
||||
"{id:category}String": "String"
|
||||
}
|
65
libs/core/_locales/sv-SE/core-jsdoc-strings.json
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"Math.abs": "Returnerar absolutbeloppet av ett tal (värdet utan hänsyn till huruvida det är positivt eller negativt). \nTill exempel är absolutbeloppet av -5 detsamma som absolutbeloppet av 5.",
|
||||
"Math.max": "Returnerar det större av två givna numeriska uttryck.",
|
||||
"Math.min": "Returnerar det mindre av två givna numeriska uttryck.",
|
||||
"Math.randomBoolean": "Genererar ett värde \"sant\" eller \"falskt\" slumpmässigt, precis som när man singlar slant.",
|
||||
"String.fromCharCode": "Gör en sträng från den givna ASCII-teckenkoden.",
|
||||
"basic": "Ger tillgång till grundläggande micro:bit funktionalitet.",
|
||||
"basic.clearScreen": "Stäng av alla lysdioder",
|
||||
"basic.forever": "Repetera koden för alltid i bakgrunden. För varje iteration, kan annan kod köra.",
|
||||
"basic.pause": "Pausa under angiven tid i millisekunder",
|
||||
"basic.pause|param|ms": "hur lång pausen är, t. ex.: 100, 200, 500, 1000, 2000",
|
||||
"basic.plotLeds": "Ritar en bild på LED-skärmen.",
|
||||
"basic.plotLeds|param|leds": "mönster av lysdioder att slå på/av",
|
||||
"basic.showAnimation": "Visar en sekvens av LED-skärmar som en animering.",
|
||||
"basic.showAnimation|param|interval": "tid i millisekunder mellan varje omritning",
|
||||
"basic.showAnimation|param|leds": "mönster av lysdioder att slå på/av",
|
||||
"basic.showLeds": "Ritar en bild på LED-skärmen.",
|
||||
"basic.showLeds|param|interval": "tid i millisekunder för att pausa efter ritning",
|
||||
"basic.showLeds|param|leds": "mönstret av lysdioder att slå på/av",
|
||||
"basic.showNumber": "Skrollar ett nummer på skärmen. Om numret passar på skärmen (dvs. är en enda siffra), skrolla inte.",
|
||||
"basic.showNumber|param|interval": "hastigheten på rullningen; t. ex.: 150, 100, 200, -100",
|
||||
"basic.showString": "Visa text på displayen, ett tecken i taget. Om strängen får plats på skärmen (dvs. är en enda bokstav), skrolla inte.",
|
||||
"basic.showString|param|interval": "hastighet på teckenbyte; t. ex.: 150, 100, 200, -100",
|
||||
"basic.showString|param|text": "texten att rullas på skärmen, t. ex.: \"Hej!\"",
|
||||
"control": "Verktyg för runtime och händelser.",
|
||||
"control.inBackground": "Schemalägger kod som körs i bakgrunden.",
|
||||
"control.reset": "Återställer BBC micro:bit.",
|
||||
"control.waitMicros": "Blockerar den aktuella fibern i antal angivna mikrosekunder",
|
||||
"control.waitMicros|param|micros": "antal mikro-sekunder att vänta. t.ex.: 4",
|
||||
"game": "En enstaka LED sprite spelmotor",
|
||||
"game.startCountdown": "Startar en spel timer",
|
||||
"game.startCountdown|param|ms": "nedräkningstid i millisekunder, t.ex.: 10000",
|
||||
"images": "Skapandet, manipulation och visning av LED bilder.",
|
||||
"images.createBigImage": "Skapar en bild med 2 ramar.",
|
||||
"images.createImage": "Skapar en bild som passar på LED-skärmen.",
|
||||
"input": "Händelser och data från sensorer",
|
||||
"input.acceleration": "Få acceleration värdet i milli-gravitys (när brädet ligger platt med skärmen upp, x=0, y=0 och z=-1024)",
|
||||
"input.buttonIsPressed": "Få knapp tillståndet (tryckt eller inte) för ``A`` och ``B``.",
|
||||
"input.buttonIsPressed|param|button": "knappen att skicka begäran om, t.ex.: Button.A",
|
||||
"input.compassHeading": "Få aktuell kompass riktning i grader.",
|
||||
"input.lightLevel": "Läser in ljusnivån som träffar LED-skärmen i ett intervall från '' 0'' (mörkt) till '' 255'' ljust.",
|
||||
"input.magneticForce": "Få magnetisk kraft värdet i ``mikro-Teslas`` (``µT``). Denna funktion stöds inte i simulatorn.",
|
||||
"input.onButtonPressed": "Göra något när du trycker på en knapp (``A``, ``B`` eller båda ``A+B``)",
|
||||
"input.onButtonPressed|param|body": "kod att köra när knappen trycks",
|
||||
"input.onPinPressed": "Gör något när du trycker på en pin.",
|
||||
"input.onPinPressed|param|body": "koden som körs när en pin är tryckt",
|
||||
"input.onPinPressed|param|name": "den pin som måste tryckas, t.ex.: TouchPin.P0",
|
||||
"input.onPinReleased": "Gör något när en pin är släppt.",
|
||||
"input.onPinReleased|param|body": "koden som körs när en pin är släppt",
|
||||
"input.onPinReleased|param|name": "den pin som behöver släppas, t.ex.: TouchPin.P0",
|
||||
"input.onScreenDown": "Fäster kod att köras när skärmen är vänd nedåt.",
|
||||
"input.onScreenUp": "Fäster kod att köras när skärmen är vänd uppåt.",
|
||||
"input.onShake": "Fäster kod att köras när enheten skakas.",
|
||||
"input.pinIsPressed": "Hämtar en pins tillstånd (tryckt eller inte). Krävs att man även håller på jord (\"GND\") för att sluta kretsen.",
|
||||
"input.pinIsPressed|param|name": "den pin som används för att upptäcka vidrörning, t.ex: TouchPin.P0",
|
||||
"led": "Kontroll av LED-skärmen.",
|
||||
"led.enable": "Slår på eller av skärmen",
|
||||
"led.plotAll": "Tänder alla lysdioder",
|
||||
"led.plotBarGraph|param|value": "aktuella värdet att rita",
|
||||
"led.screenshot": "Tar en skärmdump av LED-skärmen och returnerar en bild.",
|
||||
"led.stopAnimation": "Avbryter den aktuella animationen och rensar andra väntande animationer.",
|
||||
"led.toggleAll": "Inverterar den nuvarande LED-displayen",
|
||||
"music.ringTone": "Spelar upp en ton genom pin ``P0``.",
|
||||
"music.setTempo|param|bpm": "Det nya tempot i beats per minut, t.ex.: 120"
|
||||
}
|
174
libs/core/_locales/sv-SE/core-strings.json
Normal file
@ -0,0 +1,174 @@
|
||||
{
|
||||
"AcceleratorRange.EightG": "Accelerometern mäter krafter upp till 8 g",
|
||||
"AcceleratorRange.EightG|block": "8g",
|
||||
"AcceleratorRange.FourG": "Accelerometern mäter krafter upp till 4 g",
|
||||
"AcceleratorRange.FourG|block": "4g",
|
||||
"AcceleratorRange.OneG": "Accelerometern mäter krafter upp till 1 g",
|
||||
"AcceleratorRange.OneG|block": "1g",
|
||||
"AcceleratorRange.TwoG": "Accelerometern mäter krafter upp till 2 g",
|
||||
"AcceleratorRange.TwoG|block": "2g",
|
||||
"BaudRate.BaudRate115200|block": "115200",
|
||||
"BaudRate.BaudRate9600|block": "9600",
|
||||
"BeatFraction.Breve|block": "4",
|
||||
"BeatFraction.Double|block": "2",
|
||||
"BeatFraction.Eighth|block": "1/8",
|
||||
"BeatFraction.Half|block": "1/2",
|
||||
"BeatFraction.Quarter|block": "1/4",
|
||||
"BeatFraction.Sixteenth|block": "1/16",
|
||||
"BeatFraction.Whole|block": "1",
|
||||
"Button.AB|block": "A+B",
|
||||
"Delimiters.Dollar|block": "$",
|
||||
"Delimiters.Hash|block": "#",
|
||||
"Delimiters.NewLine|block": "ny rad",
|
||||
"Dimension.Strength|block": "styrka",
|
||||
"Dimension.X|block": "x",
|
||||
"Dimension.Y|block": "y",
|
||||
"Dimension.Z|block": "z",
|
||||
"Direction.Left|block": "vänster",
|
||||
"Direction.Right|block": "höger",
|
||||
"DisplayMode.BackAndWhite|block": "svartvitt",
|
||||
"DisplayMode.Greyscale|block": "gråskala",
|
||||
"EventCreationMode.CreateAndFire": "MicroBitEvent har initierats, och dess händelsehanterare exekveras omedelbart (ej lämpligt för användning inom avbrott!).",
|
||||
"EventCreationMode.CreateOnly": "MicroBitEvent initierats, och ingen ytterligare bearbetning sker.",
|
||||
"Gesture.EightG": "Aktiveras när en 8g stöt upptäcks",
|
||||
"Gesture.EightG|block": "8g",
|
||||
"Gesture.FreeFall": "Aktiveras när kortet faller!",
|
||||
"Gesture.FreeFall|block": "fritt fall",
|
||||
"Gesture.LogoDown": "Aktiveras när logotypen är nedåtvänd och skärmen är vertikal",
|
||||
"Gesture.LogoDown|block": "logotyp ner",
|
||||
"Gesture.LogoUp": "Aktiveras när logotypen är uppåtvänd och skärmen är vertikal",
|
||||
"Gesture.LogoUp|block": "logotyp upp",
|
||||
"Gesture.ScreenDown": "Aktiveras när skärmen pekar uppåt och kortet är horisontellt",
|
||||
"Gesture.ScreenDown|block": "skärm ner",
|
||||
"Gesture.ScreenUp": "Aktiveras när skärmen pekar nedåt och kortet är horisontellt",
|
||||
"Gesture.ScreenUp|block": "skärm upp",
|
||||
"Gesture.Shake": "Aktiveras när kortet skakas",
|
||||
"Gesture.Shake|block": "skaka",
|
||||
"Gesture.SixG": "Aktiveras när en 6g stöt upptäcks",
|
||||
"Gesture.SixG|block": "6g",
|
||||
"Gesture.ThreeG": "Aktiveras när en 3g stöt upptäcks",
|
||||
"Gesture.ThreeG|block": "3g",
|
||||
"Gesture.TiltLeft": "Aktiveras när skärmen pekar åt vänster",
|
||||
"Gesture.TiltLeft|block": "luta vänster",
|
||||
"Gesture.TiltRight": "Aktiveras när skärmen pekar åt höger",
|
||||
"Gesture.TiltRight|block": "luta höger",
|
||||
"LedSpriteProperty.Blink|block": "blinka",
|
||||
"LedSpriteProperty.Brightness|block": "ljusstyrka",
|
||||
"LedSpriteProperty.Direction|block": "riktning",
|
||||
"LedSpriteProperty.X|block": "x",
|
||||
"LedSpriteProperty.Y|block": "y",
|
||||
"Math.randomBoolean|block": "välj slumpmässigt sant eller falskt",
|
||||
"Math|block": "Matematik",
|
||||
"Note.CSharp3|block": "C#3",
|
||||
"Note.CSharp4|block": "C#4",
|
||||
"Note.CSharp5|block": "C#5",
|
||||
"Note.CSharp|block": "C#",
|
||||
"Note.FSharp3|block": "F#3",
|
||||
"Note.FSharp4|block": "F#4",
|
||||
"Note.FSharp5|block": "F#5",
|
||||
"Note.FSharp|block": "F#",
|
||||
"Note.GSharp3|block": "G#3",
|
||||
"Note.GSharp4|block": "G#4",
|
||||
"Note.GSharp5|block": "G#5",
|
||||
"Note.GSharp|block": "G#",
|
||||
"PinPullMode.PullDown|block": "ner",
|
||||
"PinPullMode.PullUp|block": "upp",
|
||||
"PulseValue.High|block": "hög",
|
||||
"PulseValue.Low|block": "låg",
|
||||
"Rotation.Pitch|block": "lutningsgrad",
|
||||
"Rotation.Roll|block": "roll",
|
||||
"String.fromCharCode|block": "text från teckenkod %code",
|
||||
"String|block": "Sträng",
|
||||
"basic.clearScreen|block": "Rensa skärmen",
|
||||
"basic.forever|block": "för alltid",
|
||||
"basic.pause|block": "pausa (ms) %pause",
|
||||
"basic.showLeds|block": "visa lysdioder",
|
||||
"basic.showNumber|block": "visa|nummer %number",
|
||||
"basic.showString|block": "visa|sträng %text",
|
||||
"basic|block": "grundläggande",
|
||||
"control.inBackground|block": "kör i bakgrunden",
|
||||
"control.reset|block": "återställ",
|
||||
"control.waitMicros|block": "vänta (µs)%micros",
|
||||
"control|block": "kontroll",
|
||||
"game.addScore|block": "ändra poäng med|%points",
|
||||
"game.gameOver|block": "spelet är slut",
|
||||
"game.score|block": "poäng",
|
||||
"game.setScore|block": "ställa in poäng %points",
|
||||
"game.startCountdown|block": "börja nedräkning|(ms) %duration",
|
||||
"game|block": "spel",
|
||||
"images.createBigImage|block": "skapa stor bild",
|
||||
"images.createImage|block": "skapa bild",
|
||||
"images|block": "bilder",
|
||||
"input.acceleration|block": "acceleration (mg) |%NAME",
|
||||
"input.buttonIsPressed|block": "knapp|%NAME|trycks",
|
||||
"input.compassHeading|block": "kompassriktning (°)",
|
||||
"input.lightLevel|block": "ljusnivå",
|
||||
"input.magneticForce|block": "magnetisk kraft (µT) |%NAME",
|
||||
"input.onButtonPressed|block": "när knapp|%NAME|trycks",
|
||||
"input.onGesture|block": "när |%NAME",
|
||||
"input.onPinPressed|block": "när pin %name|trycks",
|
||||
"input.onPinReleased|block": "när pin %NAME|släpps",
|
||||
"input.pinIsPressed|block": "pin %NAME|är tryckt",
|
||||
"input.rotation|block": "rotation (°)|%NAME",
|
||||
"input.runningTime|block": "körtid (ms)",
|
||||
"input.setAccelerometerRange|block": "ange accelerometer|räckvidd %range",
|
||||
"input.temperature|block": "temperatur (° C)",
|
||||
"input|block": "input",
|
||||
"led.brightness|block": "ljusstyrka",
|
||||
"led.enable|block": "led aktivera %on",
|
||||
"led.plotBarGraph|block": "rita diagram av %value|upp till %high",
|
||||
"led.plot|block": "tänd|x %x|y %y",
|
||||
"led.point|block": "punkt|x %x|y %y",
|
||||
"led.setBrightness|block": "ställa in ljusstyrka %value",
|
||||
"led.stopAnimation|block": "avbryt animering",
|
||||
"led.toggle|block": "växla|x %x|y %y",
|
||||
"led.unplot|block": "släck|x %x|y %y",
|
||||
"led|block": "led",
|
||||
"music.beat|block": "%fraction|taktslag",
|
||||
"music.changeTempoBy|block": "ändra tempo med (bpm)|%value",
|
||||
"music.noteFrequency|block": "%note",
|
||||
"music.playTone|block": "spela|ton %note=device_note|i %duration=device_beat",
|
||||
"music.rest|block": "vila(ms)|%duration=device_beat",
|
||||
"music.ringTone|block": "spela ton (Hz)|%note=device_note",
|
||||
"music.setTempo|block": "ställ in tempo till (bpm)|%value",
|
||||
"music.tempo|block": "tempo (bpm)",
|
||||
"music|block": "musik",
|
||||
"pins.analogPitch|block": "analog tonhöjd %frequency|för (ms) %ms",
|
||||
"pins.analogReadPin|block": "analog läsa in|pin %name",
|
||||
"pins.analogSetPeriod|block": "analog ställ in perioden|pin %pin|till (µs)%micros",
|
||||
"pins.analogSetPitchPin|block": "analog ställ in tonhöjd pin %name",
|
||||
"pins.analogWritePin|block": "analog skriv|pin %name|till %value",
|
||||
"pins.digitalReadPin|block": "digital läsa in|pin %name",
|
||||
"pins.digitalWritePin|block": "digital skriv|pin %name|till %value",
|
||||
"pins.i2cReadNumber|block": "i2c läsa in nummer|på adress %address|i format %format=i2c_sizeof",
|
||||
"pins.i2cWriteNumber|block": "i2c skriva nummer|till adress %address|med värde %value|i format %format=i2c_sizeof",
|
||||
"pins.map|block": "mappa %value|från låg %fromLow|från hög %fromHigh|till låg %toLow|till hög %toHigh",
|
||||
"pins.onPulsed|block": "när|pin %pin|pulserade %pulse",
|
||||
"pins.pulseDuration|block": "pulslängd (µs)",
|
||||
"pins.servoSetPulse|block": "servo ställa in puls|pin %value|till (µs) %micros",
|
||||
"pins.servoWritePin|block": "servo skriv|pin %name|till %value",
|
||||
"pins.setPull|block": "ställ in dra upp|pin %pin|till %pull",
|
||||
"pins.spiWrite|block": "spi skriv %value",
|
||||
"pins|block": "pins",
|
||||
"serial.onDataReceived|block": "seriell|när data tas emot %delimiters=serial_delimiter_conv",
|
||||
"serial.readLine|block": "seriell|läsa rad",
|
||||
"serial.readString|block": "seriell|läsa sträng",
|
||||
"serial.readUntil|block": "seriell|läsa tills %delimiter=serial_delimiter_conv",
|
||||
"serial.redirect|block": "seriella omdirigera till|TX %tx|RX %rx|med baud rate %rate",
|
||||
"serial.writeLine|block": "seriell|skriv rad %text",
|
||||
"serial.writeNumber|block": "seriell|skriv nummer %value",
|
||||
"serial.writeString|block": "seriell|skriv sträng %text",
|
||||
"serial.writeValue|block": "seriell|skriv värdet %name|= %värde",
|
||||
"serial|block": "seriell",
|
||||
"{id:category}Basic": "Grundläggande",
|
||||
"{id:category}Control": "Kontroll",
|
||||
"{id:category}Game": "Spel",
|
||||
"{id:category}Images": "Bilder",
|
||||
"{id:category}Input": "Input",
|
||||
"{id:category}Led": "Led",
|
||||
"{id:category}Math": "Matematik",
|
||||
"{id:category}Music": "Musik",
|
||||
"{id:category}Pins": "Pins",
|
||||
"{id:category}Serial": "Seriell",
|
||||
"{id:category}String": "Sträng"
|
||||
}
|
@ -75,6 +75,7 @@ namespace basic {
|
||||
//% help=basic/clear-screen weight=79
|
||||
//% blockId=device_clear_display block="clear screen"
|
||||
//% parts="ledmatrix"
|
||||
//% advanced=true
|
||||
void clearScreen() {
|
||||
uBit.display.image.clear();
|
||||
}
|
||||
|
@ -56,6 +56,10 @@ enum EventBusValue {
|
||||
MICROBIT_BUTTON_EVT_CLICK_ = MICROBIT_BUTTON_EVT_CLICK,
|
||||
MICROBIT_RADIO_EVT_DATAGRAM_ = MICROBIT_RADIO_EVT_DATAGRAM,
|
||||
MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE_ = MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE,
|
||||
MICROBIT_PIN_EVT_RISE_ = MICROBIT_PIN_EVT_RISE,
|
||||
MICROBIT_PIN_EVT_FALL_ = MICROBIT_PIN_EVT_FALL,
|
||||
MICROBIT_PIN_EVT_PULSE_HI_ = MICROBIT_PIN_EVT_PULSE_HI,
|
||||
MICROBIT_PIN_EVT_PULSE_LO_ = MICROBIT_PIN_EVT_PULSE_LO,
|
||||
MES_ALERT_EVT_ALARM1_ = MES_ALERT_EVT_ALARM1,
|
||||
MES_ALERT_EVT_ALARM2_ = MES_ALERT_EVT_ALARM2,
|
||||
MES_ALERT_EVT_ALARM3_ = MES_ALERT_EVT_ALARM3,
|
||||
@ -189,6 +193,7 @@ namespace control {
|
||||
* Gets a friendly name for the device derived from the its serial number
|
||||
*/
|
||||
//% blockId="control_device_name" block="device name" weight=10 blockGap=8
|
||||
//% advanced=true
|
||||
StringData* deviceName() {
|
||||
return ManagedString(microbit_friendly_name()).leakData();
|
||||
}
|
||||
@ -197,6 +202,7 @@ namespace control {
|
||||
* Derive a unique, consistent serial number of this device from internal data.
|
||||
*/
|
||||
//% blockId="control_device_serial_number" block="device serial number" weight=9
|
||||
//% advanced=true
|
||||
int deviceSerialNumber() {
|
||||
return microbit_serial_number();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ namespace control {
|
||||
* Returns the value of a C++ runtime constant
|
||||
*/
|
||||
//% weight=2 weight=19 blockId="control_event_source_id" block="%id" blockGap=8
|
||||
//% shim=TD_ID
|
||||
//% shim=TD_ID advanced=true
|
||||
export function eventSourceId(id: EventBusSource): number {
|
||||
return id;
|
||||
}
|
||||
@ -17,7 +17,7 @@ namespace control {
|
||||
* Returns the value of a C++ runtime constant
|
||||
*/
|
||||
//% weight=1 weight=19 blockId="control_event_value_id" block="%id"
|
||||
//% shim=TD_ID
|
||||
//% shim=TD_ID advanced=true
|
||||
export function eventValueId(id: EventBusValue): number {
|
||||
return id;
|
||||
}
|
||||
|
@ -21,7 +21,12 @@ namespace String_ {
|
||||
|
||||
//%
|
||||
int compare(StringData *s, StringData *that) {
|
||||
return strcmp(s->data, that->data);
|
||||
int compareResult = strcmp(s->data, that->data);
|
||||
if (compareResult < 0)
|
||||
return -1;
|
||||
else if (compareResult > 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//%
|
||||
@ -76,7 +81,7 @@ namespace Boolean_ {
|
||||
}
|
||||
|
||||
//%
|
||||
bool bang(bool v) { return !v; }
|
||||
bool bang(int v) { return v == 0; }
|
||||
}
|
||||
|
||||
namespace Number_ {
|
||||
|
42
libs/core/enums.d.ts
vendored
@ -179,6 +179,10 @@ declare namespace input {
|
||||
MICROBIT_BUTTON_EVT_CLICK = 3, // MICROBIT_BUTTON_EVT_CLICK
|
||||
MICROBIT_RADIO_EVT_DATAGRAM = 1, // MICROBIT_RADIO_EVT_DATAGRAM
|
||||
MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE = 1, // MICROBIT_ACCELEROMETER_EVT_DATA_UPDATE
|
||||
MICROBIT_PIN_EVT_RISE = 2, // MICROBIT_PIN_EVT_RISE
|
||||
MICROBIT_PIN_EVT_FALL = 3, // MICROBIT_PIN_EVT_FALL
|
||||
MICROBIT_PIN_EVT_PULSE_HI = 4, // MICROBIT_PIN_EVT_PULSE_HI
|
||||
MICROBIT_PIN_EVT_PULSE_LO = 5, // MICROBIT_PIN_EVT_PULSE_LO
|
||||
MES_ALERT_EVT_ALARM1 = 6, // MES_ALERT_EVT_ALARM1
|
||||
MES_ALERT_EVT_ALARM2 = 7, // MES_ALERT_EVT_ALARM2
|
||||
MES_ALERT_EVT_ALARM3 = 8, // MES_ALERT_EVT_ALARM3
|
||||
@ -276,6 +280,32 @@ declare namespace led {
|
||||
P3 = 10, // MICROBIT_ID_IO_P3
|
||||
P4 = 11, // MICROBIT_ID_IO_P4
|
||||
P10 = 17, // MICROBIT_ID_IO_P10
|
||||
//% block="P5 (write only)"
|
||||
P5 = 12, // MICROBIT_ID_IO_P5
|
||||
//% block="P6 (write only)"
|
||||
P6 = 13, // MICROBIT_ID_IO_P6
|
||||
//% block="P5 (write only)"
|
||||
P7 = 14, // MICROBIT_ID_IO_P7
|
||||
//% block="P8 (write only)"
|
||||
P8 = 15, // MICROBIT_ID_IO_P8
|
||||
//% block="P9 (write only)"
|
||||
P9 = 16, // MICROBIT_ID_IO_P9
|
||||
//% block="P11 (write only)"
|
||||
P11 = 18, // MICROBIT_ID_IO_P11
|
||||
//% block="P12 (write only)"
|
||||
P12 = 19, // MICROBIT_ID_IO_P12
|
||||
//% block="P13 (write only)"
|
||||
P13 = 20, // MICROBIT_ID_IO_P13
|
||||
//% block="P14 (write only)"
|
||||
P14 = 21, // MICROBIT_ID_IO_P14
|
||||
//% block="P15 (write only)"
|
||||
P15 = 22, // MICROBIT_ID_IO_P15
|
||||
//% block="P16 (write only)"
|
||||
P16 = 23, // MICROBIT_ID_IO_P16
|
||||
//% block="P19 (write only)"
|
||||
P19 = 24, // MICROBIT_ID_IO_P19
|
||||
//% block="P20 (write only)"
|
||||
P20 = 25, // MICROBIT_ID_IO_P20
|
||||
}
|
||||
|
||||
|
||||
@ -297,6 +327,18 @@ declare namespace led {
|
||||
}
|
||||
|
||||
|
||||
declare enum PinEventType {
|
||||
//% block="edge"
|
||||
Edge = 1, // MICROBIT_PIN_EVENT_ON_EDGE
|
||||
//% block="pulse"
|
||||
Pulse = 2, // MICROBIT_PIN_EVENT_ON_PULSE
|
||||
//% block="touch"
|
||||
Touch = 3, // MICROBIT_PIN_EVENT_ON_TOUCH
|
||||
//% block="none"
|
||||
None = 0, // MICROBIT_PIN_EVENT_NONE
|
||||
}
|
||||
|
||||
|
||||
declare enum SerialPin {
|
||||
P0 = 7, // MICROBIT_ID_IO_P0
|
||||
P1 = 8, // MICROBIT_ID_IO_P1
|
||||
|
521
libs/core/icons.ts
Normal file
@ -0,0 +1,521 @@
|
||||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2016 The MicroPython-on-micro:bit Developers, as listed
|
||||
in the accompanying AUTHORS file
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// Images from file microbitconstimage.cpp https://github.com/bbcmicrobit/micropython
|
||||
|
||||
enum IconNames {
|
||||
//% block="heart"
|
||||
Heart = 0,
|
||||
//% block="small heart"
|
||||
SmallHeart,
|
||||
//% block="yes"
|
||||
Yes,
|
||||
//% block="no"
|
||||
No,
|
||||
//% block="happy"
|
||||
Happy,
|
||||
//% block="sad"
|
||||
Sad,
|
||||
//% block="confused"
|
||||
Confused,
|
||||
//% block="angry"
|
||||
Angry,
|
||||
//% block="asleep"
|
||||
Asleep,
|
||||
//% block="surprised"
|
||||
Surprised,
|
||||
//% block="silly"
|
||||
Silly,
|
||||
//% block="fabulous"
|
||||
Fabulous,
|
||||
//% block="meh"
|
||||
Meh,
|
||||
//% block="t-shirt"
|
||||
TShirt,
|
||||
//% block="roller skate"
|
||||
Rollerskate,
|
||||
//% block="duck"
|
||||
Duck,
|
||||
//% block="house"
|
||||
House,
|
||||
//% block="tortoise"
|
||||
Tortoise,
|
||||
//% block="butterfly"
|
||||
Butterfly,
|
||||
//% block="stick figure"
|
||||
StickFigure,
|
||||
//% block="ghost"
|
||||
Ghost,
|
||||
//% block="sword"
|
||||
Sword,
|
||||
//% block="giraffe"
|
||||
Giraffe,
|
||||
//% block="skull"
|
||||
Skull,
|
||||
//% block="umbrella"
|
||||
Umbrella,
|
||||
//% block="snake"
|
||||
Snake,
|
||||
//% block="rabbit"
|
||||
Rabbit,
|
||||
//% block="cow"
|
||||
Cow,
|
||||
//% block="quarter note"
|
||||
QuarterNote,
|
||||
//% block="eigth note"
|
||||
EigthNote,
|
||||
//% block="pitchfork"
|
||||
Pitchfork,
|
||||
//% block="pac man"
|
||||
Pacman,
|
||||
//% block="target"
|
||||
Target,
|
||||
//% block="triangle"
|
||||
Triangle,
|
||||
//% block="left triangle"
|
||||
LeftTriangle,
|
||||
//% block="chess board"
|
||||
Chessboard,
|
||||
//% block="diamond"
|
||||
Diamond,
|
||||
//% block="small diamond"
|
||||
SmallDiamond,
|
||||
//% block="square"
|
||||
Square,
|
||||
//% block="small square"
|
||||
SmallSquare,
|
||||
}
|
||||
|
||||
enum ArrowNames {
|
||||
//% blockIdentity=images.arrowNumber
|
||||
North = 0,
|
||||
//% blockIdentity=images.arrowNumber
|
||||
NorthEast,
|
||||
//% blockIdentity=images.arrowNumber
|
||||
East,
|
||||
//% blockIdentity=images.arrowNumber
|
||||
SouthEast,
|
||||
//% blockIdentity=images.arrowNumber
|
||||
South,
|
||||
//% blockIdentity=images.arrowNumber
|
||||
SouthWest,
|
||||
//% blockIdentity=images.arrowNumber
|
||||
West,
|
||||
//% blockIdentity=images.arrowNumber
|
||||
NorthWest,
|
||||
}
|
||||
|
||||
namespace basic {
|
||||
|
||||
/**
|
||||
* Draws the selected icon on the LED screen
|
||||
*/
|
||||
//% weight=90 blockGap=8
|
||||
//% blockId=basic_show_icon
|
||||
//% block="show icon %i" icon="\uf00a"
|
||||
//% parts="ledmatrix"
|
||||
export function showIcon(icon: IconNames) {
|
||||
let res = images.iconImage(icon)
|
||||
res.showImage(0)
|
||||
}
|
||||
|
||||
//% weight=50 blockGap=8
|
||||
//% blockId=basic_show_arrow
|
||||
//% block="show arrow %i=device_arrow"
|
||||
//% parts="ledmatrix"
|
||||
//% advanced=true
|
||||
export function showArrow(i: number) {
|
||||
let res = images.arrowImage(i)
|
||||
res.showImage(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace images {
|
||||
|
||||
function getArrow(i : ArrowNames): string {
|
||||
switch(i) {
|
||||
// compass directions
|
||||
case ArrowNames.North: return `
|
||||
. . # . .
|
||||
. # # # .
|
||||
# . # . #
|
||||
. . # . .
|
||||
. . # . .`;
|
||||
case ArrowNames.NorthEast: return `
|
||||
. . # # #
|
||||
. . . # #
|
||||
. . # . #
|
||||
. # . . .
|
||||
# . . . .`;
|
||||
case ArrowNames.East: return `
|
||||
. . # . .
|
||||
. . . # .
|
||||
# # # # #
|
||||
. . . # .
|
||||
. . # . .`;
|
||||
case ArrowNames.SouthEast: return `
|
||||
# . . . .
|
||||
. # . . .
|
||||
. . # . #
|
||||
. . . # #
|
||||
. . # # #`;
|
||||
case ArrowNames.South: return `
|
||||
. . # . .
|
||||
. . # . .
|
||||
# . # . #
|
||||
. # # # .
|
||||
. . # . .`;
|
||||
case ArrowNames.SouthWest: return `
|
||||
. . . . #
|
||||
. . . # .
|
||||
# . # . .
|
||||
# # . . .
|
||||
# # # . .`;
|
||||
case ArrowNames.West: return `
|
||||
. . # . .
|
||||
. # . . .
|
||||
# # # # #
|
||||
. # . . .
|
||||
. . # . .`;
|
||||
case ArrowNames.NorthWest: return `
|
||||
# # # . .
|
||||
# # . . .
|
||||
# . # . .
|
||||
. . . # .
|
||||
. . . . #`;
|
||||
default: return `
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
function getIcon(i: IconNames): string {
|
||||
|
||||
switch (i) {
|
||||
case IconNames.Heart : return `
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`;
|
||||
|
||||
case IconNames.SmallHeart : return `
|
||||
. . . . .
|
||||
. # . # .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .`;
|
||||
//faces
|
||||
case IconNames.Happy: return `
|
||||
. . . . .
|
||||
. # . # .
|
||||
. . . . .
|
||||
# . . . #
|
||||
. # # # .`;
|
||||
case IconNames.Sad: return `
|
||||
. . . . .
|
||||
. # . # .
|
||||
. . . . .
|
||||
. # # # .
|
||||
# . . . #`;
|
||||
case IconNames.Confused: return `
|
||||
. . . . .
|
||||
. # . # .
|
||||
. . . . .
|
||||
. # . # .
|
||||
# . # . #`;
|
||||
case IconNames.Angry: return `
|
||||
# . . . #
|
||||
. # . # .
|
||||
. . . . .
|
||||
# # # # #
|
||||
# . # . #`;
|
||||
case IconNames.Asleep: return `
|
||||
. . . . .
|
||||
# # . # #
|
||||
. . . . .
|
||||
. # # # .
|
||||
. . . . .`;
|
||||
case IconNames.Surprised: return `
|
||||
. # . # .
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # . # .
|
||||
. . # . .`;
|
||||
case IconNames.Silly: return `
|
||||
# . . . #
|
||||
. . . . .
|
||||
# # # # #
|
||||
. . . # #
|
||||
. . . # #`;
|
||||
case IconNames.Fabulous: return `
|
||||
# # # # #
|
||||
# # . # #
|
||||
. . . . .
|
||||
. # . # .
|
||||
. # # # .`;
|
||||
case IconNames.Meh: return `
|
||||
# # . # #
|
||||
. . . . .
|
||||
. . . # .
|
||||
. . # . .
|
||||
. # . . .`;
|
||||
case IconNames.Yes: return `
|
||||
. . . . .
|
||||
. . . . #
|
||||
. . . # .
|
||||
# . # . .
|
||||
. # . . .`;
|
||||
case IconNames.No: return `
|
||||
# . . . #
|
||||
. # . # .
|
||||
. . # . .
|
||||
. # . # .
|
||||
# . . . #`;
|
||||
case IconNames.Triangle: return `
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # . # .
|
||||
# # # # #
|
||||
. . . . .`;
|
||||
case IconNames.LeftTriangle: return `
|
||||
# . . . .
|
||||
# # . . .
|
||||
# . # . .
|
||||
# . . # .
|
||||
# # # # #`;
|
||||
case IconNames.Chessboard: return `
|
||||
. # . # .
|
||||
# . # . #
|
||||
. # . # .
|
||||
# . # . #
|
||||
. # . # .`;
|
||||
case IconNames.Diamond: return `
|
||||
. . # . .
|
||||
. # . # .
|
||||
# . . . #
|
||||
. # . # .
|
||||
. . # . .`;
|
||||
case IconNames.SmallDiamond: return `
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # . # .
|
||||
. . # . .
|
||||
. . . . .`;
|
||||
case IconNames.Square: return `
|
||||
# # # # #
|
||||
# . . . #
|
||||
# . . . #
|
||||
# . . . #
|
||||
# # # # #`;
|
||||
case IconNames.SmallSquare: return `
|
||||
. . . . .
|
||||
. # # # .
|
||||
. # . # .
|
||||
. # # # .
|
||||
. . . . .`;
|
||||
// The following images were designed by Abbie Brooks.
|
||||
case IconNames.TShirt: return `
|
||||
# # . # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. # # # .
|
||||
. # # # .`;
|
||||
case IconNames.Rollerskate: return `
|
||||
. . . # #
|
||||
. . . # #
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # . # .`;
|
||||
case IconNames.Duck: return `
|
||||
. # # . .
|
||||
# # # . .
|
||||
. # # # #
|
||||
. # # # .
|
||||
. .. . .`;
|
||||
case IconNames.House: return `
|
||||
. . # . .
|
||||
. # # # .
|
||||
# # # # #
|
||||
. # # # .
|
||||
. # . # .`;
|
||||
case IconNames.Tortoise: return `
|
||||
. . . . .
|
||||
. # # # .
|
||||
# # # # #
|
||||
. # . # .
|
||||
. . . . .`;
|
||||
case IconNames.Butterfly: return `
|
||||
# # . # #
|
||||
# # # # #
|
||||
. . # . .
|
||||
# # # # #
|
||||
# # . # #`;
|
||||
case IconNames.StickFigure: return `
|
||||
. . # . .
|
||||
# # # # #
|
||||
. . # . .
|
||||
. # . # .
|
||||
# . . . #`;
|
||||
case IconNames.Ghost: return `
|
||||
. # # # .
|
||||
# . # . #
|
||||
# # # # #
|
||||
# # # # #
|
||||
# . # . #`;
|
||||
case IconNames.Sword: return `
|
||||
. . # . .
|
||||
. . # . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .`;
|
||||
case IconNames.Giraffe: return `
|
||||
# # . . .
|
||||
. # . . .
|
||||
. # . . .
|
||||
. # # # .
|
||||
. # . # .`;
|
||||
case IconNames.Skull: return `
|
||||
. # # # .
|
||||
# . # . #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. # # # .`;
|
||||
case IconNames.Umbrella: return `
|
||||
. # # # .
|
||||
# # # # #
|
||||
. . # . .
|
||||
# . # . .
|
||||
# # # . .`;
|
||||
case IconNames.Snake: return `
|
||||
# # . . .
|
||||
# # . # #
|
||||
. # . # .
|
||||
. # # # .
|
||||
. . . . .`;
|
||||
// animals
|
||||
case IconNames.Rabbit: return `
|
||||
# . # . .
|
||||
# . # . .
|
||||
# # # # .
|
||||
# # . # .
|
||||
# # # # .`;
|
||||
case IconNames.Cow: return `
|
||||
# . . . #
|
||||
# . . . #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`;
|
||||
// musical notes
|
||||
case IconNames.QuarterNote: return `
|
||||
. . # . .
|
||||
. . # . .
|
||||
. . # . .
|
||||
# # # . .
|
||||
# # # . .`;
|
||||
case IconNames.EigthNote: return `
|
||||
. . # . .
|
||||
. . # # .
|
||||
. . # . #
|
||||
# # # . .
|
||||
# # # . .`;
|
||||
// other icons
|
||||
case IconNames.Pitchfork: return `
|
||||
# . # . #
|
||||
# . # . #
|
||||
# # # # #
|
||||
. . # . .
|
||||
. . # . .`;
|
||||
case IconNames.Pacman: return `
|
||||
. # # # #
|
||||
# # # # .
|
||||
# # # . .
|
||||
# # # # .
|
||||
. # # # #`;
|
||||
case IconNames.Target: return `
|
||||
. . # . .
|
||||
. # # # .
|
||||
# # . # #
|
||||
. # # # .
|
||||
. . # . .`;
|
||||
default: return `
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
//% weight=50 blockGap=8
|
||||
//% blockId=device_arrow block="%arrow"
|
||||
//% shim=TD_ID
|
||||
export function arrowNumber(arrow: ArrowNames): number {
|
||||
return arrow;
|
||||
}
|
||||
|
||||
//% weight=50 blockGap=8
|
||||
//% blockId=builtin_arrow_image block="arrow image %i=device_arrow"
|
||||
export function arrowImage(i: ArrowNames): Image {
|
||||
let res = images.createImage(`
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
`)
|
||||
return set(res, getArrow(i));
|
||||
}
|
||||
|
||||
//% weight=50 blockGap=8
|
||||
//% blockId=builtin_image block="icon image %i"
|
||||
export function iconImage(i: IconNames): Image {
|
||||
let res = images.createImage(`
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
`)
|
||||
return set(res, getIcon(i));
|
||||
}
|
||||
|
||||
function set(res: Image, s: string) {
|
||||
let j = 0;
|
||||
for (let x of s) {
|
||||
if (x == "." || x == "#") {
|
||||
res.setPixel(j % 5, j / 5, x == "#")
|
||||
j++
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
}
|
@ -43,9 +43,9 @@ namespace ImageMethods {
|
||||
*/
|
||||
//% help=images/show-image weight=80 blockNamespace=images
|
||||
//% blockId=device_show_image_offset block="show image %sprite|at offset %offset" blockGap=8
|
||||
//% parts="ledmatrix"
|
||||
void showImage(Image sprite, int xOffset) {
|
||||
uBit.display.print(MicroBitImage(sprite), -xOffset, 0, 0);
|
||||
//% parts="ledmatrix" async
|
||||
void showImage(Image sprite, int xOffset, int interval = 400) {
|
||||
uBit.display.print(MicroBitImage(sprite), -xOffset, 0, 0, interval);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -150,7 +150,7 @@ namespace ImageMethods {
|
||||
*/
|
||||
//% weight=70 help=images/show-frame
|
||||
//% parts="ledmatrix"
|
||||
void showFrame(Image i, int frame) {
|
||||
showImage(i, frame * 5);
|
||||
void showFrame(Image i, int frame, int interval = 400) {
|
||||
showImage(i, frame * 5, interval);
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ namespace music {
|
||||
*/
|
||||
//% weight=50 help=music/note-frequency
|
||||
//% blockId=device_note block="%note"
|
||||
//% shim=TD_ID
|
||||
//% shim=TD_ID blockHidden=true
|
||||
export function noteFrequency(name: Note): number {
|
||||
return name;
|
||||
}
|
||||
|
@ -29,6 +29,32 @@ enum class AnalogPin {
|
||||
P3 = MICROBIT_ID_IO_P3,
|
||||
P4 = MICROBIT_ID_IO_P4,
|
||||
P10 = MICROBIT_ID_IO_P10,
|
||||
//% block="P5 (write only)"
|
||||
P5 = MICROBIT_ID_IO_P5,
|
||||
//% block="P6 (write only)"
|
||||
P6 = MICROBIT_ID_IO_P6,
|
||||
//% block="P5 (write only)"
|
||||
P7 = MICROBIT_ID_IO_P7,
|
||||
//% block="P8 (write only)"
|
||||
P8 = MICROBIT_ID_IO_P8,
|
||||
//% block="P9 (write only)"
|
||||
P9 = MICROBIT_ID_IO_P9,
|
||||
//% block="P11 (write only)"
|
||||
P11 = MICROBIT_ID_IO_P11,
|
||||
//% block="P12 (write only)"
|
||||
P12 = MICROBIT_ID_IO_P12,
|
||||
//% block="P13 (write only)"
|
||||
P13 = MICROBIT_ID_IO_P13,
|
||||
//% block="P14 (write only)"
|
||||
P14 = MICROBIT_ID_IO_P14,
|
||||
//% block="P15 (write only)"
|
||||
P15 = MICROBIT_ID_IO_P15,
|
||||
//% block="P16 (write only)"
|
||||
P16 = MICROBIT_ID_IO_P16,
|
||||
//% block="P19 (write only)"
|
||||
P19 = MICROBIT_ID_IO_P19,
|
||||
//% block="P20 (write only)"
|
||||
P20 = MICROBIT_ID_IO_P20
|
||||
};
|
||||
|
||||
enum class PulseValue {
|
||||
@ -47,6 +73,17 @@ enum class PinPullMode {
|
||||
PullNone = 2
|
||||
};
|
||||
|
||||
enum class PinEventType {
|
||||
//% block="edge"
|
||||
Edge = MICROBIT_PIN_EVENT_ON_EDGE,
|
||||
//% block="pulse"
|
||||
Pulse = MICROBIT_PIN_EVENT_ON_PULSE,
|
||||
//% block="touch"
|
||||
Touch = MICROBIT_PIN_EVENT_ON_TOUCH,
|
||||
//% block="none"
|
||||
None = MICROBIT_PIN_EVENT_NONE
|
||||
};
|
||||
|
||||
MicroBitPin *getPin(int id) {
|
||||
switch (id) {
|
||||
case MICROBIT_ID_IO_P0: return &uBit.io.P0;
|
||||
@ -107,7 +144,7 @@ namespace pins {
|
||||
*/
|
||||
//% help=pins/digital-write-pin weight=29
|
||||
//% blockId=device_set_digital_pin block="digital write|pin %name|to %value"
|
||||
void digitalWritePin(DigitalPin name, int value) {
|
||||
void digitalWritePin(DigitalPin name, int value) {
|
||||
PINOP(setDigitalValue(value));
|
||||
}
|
||||
|
||||
@ -116,7 +153,7 @@ namespace pins {
|
||||
* @param name pin to write to, eg: AnalogPin.P0
|
||||
*/
|
||||
//% help=pins/analog-read-pin weight=25
|
||||
//% blockId=device_get_analog_pin block="analog read|pin %name" blockGap="8"
|
||||
//% blockId=device_get_analog_pin block="analog read|pin %name" blockGap="8"
|
||||
int analogReadPin(AnalogPin name) {
|
||||
PINREAD(getAnalogValue());
|
||||
}
|
||||
@ -128,7 +165,7 @@ namespace pins {
|
||||
*/
|
||||
//% help=pins/analog-write-pin weight=24
|
||||
//% blockId=device_set_analog_pin block="analog write|pin %name|to %value" blockGap=8
|
||||
void analogWritePin(AnalogPin name, int value) {
|
||||
void analogWritePin(AnalogPin name, int value) {
|
||||
PINOP(setAnalogValue(value));
|
||||
}
|
||||
|
||||
@ -139,11 +176,11 @@ namespace pins {
|
||||
* @param micros period in micro seconds. eg:20000
|
||||
*/
|
||||
//% help=pins/analog-set-period weight=23 blockGap=8
|
||||
//% blockId=device_set_analog_period block="analog set period|pin %pin|to (µs)%micros"
|
||||
void analogSetPeriod(AnalogPin name, int micros) {
|
||||
//% blockId=device_set_analog_period block="analog set period|pin %pin|to (µs)%micros"
|
||||
void analogSetPeriod(AnalogPin name, int micros) {
|
||||
PINOP(setAnalogPeriodUs(micros));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Configures this pin to a digital input, and generates events where the timestamp is the duration that this pin was either ``high`` or ``low``.
|
||||
* @param name digital pin to register to, eg: DigitalPin.P0
|
||||
@ -154,11 +191,11 @@ namespace pins {
|
||||
void onPulsed(DigitalPin name, PulseValue pulse, Action body) {
|
||||
MicroBitPin* pin = getPin((int)name);
|
||||
if (!pin) return;
|
||||
|
||||
pin->eventOn(MICROBIT_PIN_EVENT_ON_PULSE);
|
||||
|
||||
pin->eventOn(MICROBIT_PIN_EVENT_ON_PULSE);
|
||||
registerWithDal((int)name, (int)pulse, body);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the duration of the last pulse in micro-seconds. This function should be called from a ``onPulsed`` handler.
|
||||
*/
|
||||
@ -174,7 +211,7 @@ namespace pins {
|
||||
* @param name the pin which measures the pulse, eg: DigitalPin.P0
|
||||
* @param value the value of the pulse, eg: PulseValue.High
|
||||
* @param maximum duration in micro-seconds
|
||||
*/
|
||||
*/
|
||||
//% blockId="pins_pulse_in" block="pulse in (µs)|pin %name|pulsed %value"
|
||||
//% weight=20 advanced=true
|
||||
int pulseIn(DigitalPin name, PulseValue value, int maxDuration = 2000000) {
|
||||
@ -182,20 +219,20 @@ namespace pins {
|
||||
if (!pin) return 0;
|
||||
|
||||
int pulse = value == PulseValue::High ? 1 : 0;
|
||||
uint64_t tick = system_timer_current_time_us();
|
||||
uint64_t maxd = (uint64_t)maxDuration;
|
||||
uint64_t tick = system_timer_current_time_us();
|
||||
uint64_t maxd = (uint64_t)maxDuration;
|
||||
while(pin->getDigitalValue() != pulse) {
|
||||
if(system_timer_current_time_us() - tick > maxd)
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t start = system_timer_current_time_us();
|
||||
uint64_t start = system_timer_current_time_us();
|
||||
while(pin->getDigitalValue() == pulse) {
|
||||
if(system_timer_current_time_us() - tick > maxd)
|
||||
return 0;
|
||||
}
|
||||
uint64_t end = system_timer_current_time_us();
|
||||
return end - start;
|
||||
return 0;
|
||||
}
|
||||
uint64_t end = system_timer_current_time_us();
|
||||
return end - start;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -206,7 +243,7 @@ namespace pins {
|
||||
//% help=pins/servo-write-pin weight=20
|
||||
//% blockId=device_set_servo_pin block="servo write|pin %name|to %value" blockGap=8
|
||||
//% parts=microservo trackArgs=0
|
||||
void servoWritePin(AnalogPin name, int value) {
|
||||
void servoWritePin(AnalogPin name, int value) {
|
||||
PINOP(setServoValue(value));
|
||||
}
|
||||
|
||||
@ -217,7 +254,7 @@ namespace pins {
|
||||
*/
|
||||
//% help=pins/servo-set-pulse weight=19
|
||||
//% blockId=device_set_servo_pulse block="servo set pulse|pin %value|to (µs) %micros"
|
||||
void servoSetPulse(AnalogPin name, int micros) {
|
||||
void servoSetPulse(AnalogPin name, int micros) {
|
||||
PINOP(setServoPulseUs(micros));
|
||||
}
|
||||
|
||||
@ -230,7 +267,7 @@ namespace pins {
|
||||
*/
|
||||
//% blockId=device_analog_set_pitch_pin block="analog set pitch pin %name"
|
||||
//% help=pins/analog-set-pitch weight=3 advanced=true
|
||||
void analogSetPitchPin(AnalogPin name) {
|
||||
void analogSetPitchPin(AnalogPin name) {
|
||||
pitchPin = getPin((int)name);
|
||||
}
|
||||
|
||||
@ -241,8 +278,8 @@ namespace pins {
|
||||
*/
|
||||
//% blockId=device_analog_pitch block="analog pitch %frequency|for (ms) %ms"
|
||||
//% help=pins/analog-pitch weight=4 async advanced=true blockGap=8
|
||||
void analogPitch(int frequency, int ms) {
|
||||
if (pitchPin == NULL)
|
||||
void analogPitch(int frequency, int ms) {
|
||||
if (pitchPin == NULL)
|
||||
analogSetPitchPin(AnalogPin::P0);
|
||||
if (frequency <= 0) {
|
||||
pitchPin->setAnalogValue(0);
|
||||
@ -250,7 +287,7 @@ namespace pins {
|
||||
pitchPin->setAnalogValue(512);
|
||||
pitchPin->setAnalogPeriodUs(1000000/frequency);
|
||||
}
|
||||
|
||||
|
||||
if (ms > 0) {
|
||||
fiber_sleep(ms);
|
||||
pitchPin->setAnalogValue(0);
|
||||
@ -259,7 +296,7 @@ namespace pins {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Configures the pull of this pin.
|
||||
* @param name pin to set the pull mode on, eg: DigitalPin.P0
|
||||
@ -268,13 +305,25 @@ namespace pins {
|
||||
//% help=pins/set-pull weight=3 advanced=true
|
||||
//% blockId=device_set_pull block="set pull|pin %pin|to %pull"
|
||||
void setPull(DigitalPin name, PinPullMode pull) {
|
||||
PinMode m = pull == PinPullMode::PullDown
|
||||
PinMode m = pull == PinPullMode::PullDown
|
||||
? PinMode::PullDown
|
||||
: pull == PinPullMode::PullUp ? PinMode::PullUp
|
||||
: pull == PinPullMode::PullUp ? PinMode::PullUp
|
||||
: PinMode::PullNone;
|
||||
PINOP(setPull(m));
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures the events emitted by this pin. Events can be subscribed to
|
||||
* using ``control.onEvent()``.
|
||||
* @param name pin to set the event mode on, eg: DigitalPin.P0
|
||||
* @param type the type of events for this pin to emit, eg: PinEventType.Edge
|
||||
*/
|
||||
//% help=pins/set-events weight=4 advanced=true
|
||||
//% blockId=device_set_pin_events block="set pin %pin|to emit %type|events"
|
||||
void setEvents(DigitalPin name, PinEventType type) {
|
||||
getPin((int)name)->eventOn((int)type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new zero-initialized buffer.
|
||||
* @param size number of bytes in the buffer
|
||||
@ -295,7 +344,7 @@ namespace pins {
|
||||
uBit.i2c.read(address << 1, (char*)buf->payload, size, repeat);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Write bytes to a 7-bit I2C `address`.
|
||||
*/
|
||||
@ -322,5 +371,5 @@ namespace pins {
|
||||
auto p = allocSPI();
|
||||
return p->write(value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -150,15 +150,9 @@ namespace pxt {
|
||||
|
||||
if (i < length)
|
||||
{
|
||||
if (data[i] != Segment::MissingValue)
|
||||
{
|
||||
return data[i];
|
||||
}
|
||||
error(ERR_MISSING_VALUE);
|
||||
return 0;
|
||||
}
|
||||
error(ERR_OUT_OF_BOUNDS);
|
||||
return 0;
|
||||
return Segment::DefaultValue;
|
||||
}
|
||||
|
||||
void Segment::set(uint32_t i, uint32_t value)
|
||||
@ -223,12 +217,8 @@ namespace pxt {
|
||||
{
|
||||
memcpy(tmp, data, size * sizeof(uint32_t));
|
||||
}
|
||||
|
||||
//fill the rest with missing values;
|
||||
for(uint16_t i = size; i < newSize; i++)
|
||||
{
|
||||
tmp[i] = Segment::MissingValue;
|
||||
}
|
||||
//fill the rest with default value
|
||||
memset(tmp + size, Segment::DefaultValue, (newSize - size) * sizeof(uint32_t));
|
||||
|
||||
//free older segment;
|
||||
::operator delete(data);
|
||||
@ -280,12 +270,11 @@ namespace pxt {
|
||||
if (length > 0)
|
||||
{
|
||||
uint32_t value = data[length];
|
||||
data[length] = Segment::MissingValue;
|
||||
data[length] = Segment::DefaultValue;
|
||||
--length;
|
||||
return value;
|
||||
}
|
||||
error(ERR_OUT_OF_BOUNDS);
|
||||
return 0;
|
||||
return Segment::DefaultValue;
|
||||
}
|
||||
|
||||
//this function removes an element at index i and shifts the rest of the elements to
|
||||
@ -306,15 +295,14 @@ namespace pxt {
|
||||
memmove(data + i, data + i + 1, (length - i - 1) * sizeof(uint32_t));
|
||||
}
|
||||
length--;
|
||||
data[length] = Segment::MissingValue;
|
||||
data[length] = Segment::DefaultValue;
|
||||
#ifdef DEBUG_BUILD
|
||||
printf("After Segment::remove index:%u\n", i);
|
||||
this->print();
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
error(ERR_OUT_OF_BOUNDS);
|
||||
return 0;
|
||||
return Segment::DefaultValue;
|
||||
}
|
||||
|
||||
//this function inserts element value at index i by shifting the rest of the elements right.
|
||||
@ -350,42 +338,23 @@ namespace pxt {
|
||||
|
||||
void Segment::print()
|
||||
{
|
||||
printf("Segment: %x, length: %u, size: %u\n", data, (uint)length, (uint)size);
|
||||
for(uint i = 0; i < size; i++)
|
||||
printf("Segment: %x, length: %u, size: %u\n", data, (uint32_t)length, (uint32_t)size);
|
||||
for(uint32_t i = 0; i < size; i++)
|
||||
{
|
||||
printf("%d ",(uint)data[i]);
|
||||
printf("%d ",(uint32_t)data[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
bool Segment::isValidIndex(uint32_t i)
|
||||
{
|
||||
if (i > length || data[i] == Segment::MissingValue)
|
||||
if (i > length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Segment::getNextValidIndex(uint32_t i, uint32_t *result)
|
||||
{
|
||||
while (i < length)
|
||||
{
|
||||
if (data[i] != Segment::MissingValue)
|
||||
{
|
||||
*result = i;
|
||||
|
||||
#ifdef DEBUG_BUILD
|
||||
printf("In Segment::getNextValidIndex result=%u\n",i);
|
||||
this->print();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Segment::destroy()
|
||||
{
|
||||
#ifdef DEBUG_BUILD
|
||||
@ -415,29 +384,16 @@ namespace pxt {
|
||||
|
||||
uint32_t RefCollection::getAt(int i)
|
||||
{
|
||||
if (head.isValidIndex(i))
|
||||
uint32_t tmp = head.get(i);
|
||||
if (isRef())
|
||||
{
|
||||
uint32_t tmp = head.get(i);
|
||||
if (isRef())
|
||||
{
|
||||
incr(tmp);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
error(ERR_OUT_OF_BOUNDS);
|
||||
return 0;
|
||||
incr(tmp);
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
uint32_t RefCollection::removeAt(int i)
|
||||
{
|
||||
if (!head.isValidIndex((uint32_t)i))
|
||||
{
|
||||
error(ERR_OUT_OF_BOUNDS);
|
||||
return 0;
|
||||
}
|
||||
if (isRef())
|
||||
{
|
||||
decr(head.get(i));
|
||||
@ -447,18 +403,11 @@ namespace pxt {
|
||||
|
||||
void RefCollection::insertAt(int i, uint32_t value)
|
||||
{
|
||||
if (i < length())
|
||||
head.insert(i, value);
|
||||
if (isRef())
|
||||
{
|
||||
head.insert(i, value);
|
||||
if (isRef())
|
||||
{
|
||||
incr(value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error(ERR_OUT_OF_BOUNDS);
|
||||
}
|
||||
incr(value);
|
||||
}
|
||||
}
|
||||
|
||||
void RefCollection::setAt(int i, uint32_t value)
|
||||
@ -480,26 +429,31 @@ namespace pxt {
|
||||
{
|
||||
StringData *xx = (StringData*)x;
|
||||
uint32_t i = start;
|
||||
while(head.getNextValidIndex(start, &i))
|
||||
while(head.isValidIndex(i))
|
||||
{
|
||||
StringData *ee = (StringData*)head.get(i);
|
||||
if (xx->len == ee->len && memcmp(xx->data, ee->data, xx->len) == 0)
|
||||
if (ee == xx)
|
||||
{
|
||||
//handles ee being null
|
||||
return (int) i;
|
||||
}
|
||||
if (ee && xx->len == ee->len && memcmp(xx->data, ee->data, xx->len) == 0)
|
||||
{
|
||||
return (int)i;
|
||||
}
|
||||
start = i;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32_t i = start;
|
||||
while(head.getNextValidIndex(start, &i))
|
||||
while(head.isValidIndex(i))
|
||||
{
|
||||
if (head.get(i) == x)
|
||||
{
|
||||
return (int)i;
|
||||
}
|
||||
start = i;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -550,12 +504,9 @@ namespace pxt {
|
||||
{
|
||||
if (this->isRef())
|
||||
{
|
||||
uint32_t start = 0;
|
||||
uint32_t i = 0;
|
||||
while(head.getNextValidIndex(start, &i))
|
||||
for(uint32_t i = 0; i < this->head.getLength(); i++)
|
||||
{
|
||||
decr(this->head.get(i));
|
||||
start = i;
|
||||
}
|
||||
}
|
||||
this->head.destroy();
|
||||
|
@ -38,7 +38,6 @@ namespace pxt {
|
||||
ERR_OUT_OF_BOUNDS = 8,
|
||||
ERR_REF_DELETED = 7,
|
||||
ERR_SIZE = 9,
|
||||
ERR_MISSING_VALUE = 10,
|
||||
} ERROR;
|
||||
|
||||
extern const uint32_t functionsAndBytecode[];
|
||||
@ -175,7 +174,7 @@ namespace pxt {
|
||||
uint16_t size;
|
||||
|
||||
static const uint16_t MaxSize = 0xFFFF;
|
||||
static const uint32_t MissingValue = 0x80000000;
|
||||
static const uint32_t DefaultValue = 0x0;
|
||||
|
||||
static uint16_t growthFactor(uint16_t size);
|
||||
void growByMin(uint16_t minSize);
|
||||
@ -197,10 +196,6 @@ namespace pxt {
|
||||
uint32_t remove(uint32_t i);
|
||||
void insert(uint32_t i, uint32_t value);
|
||||
|
||||
//Returns true if there is a valid index greater than or equal to 'i', returns false otherwise
|
||||
//If 'i' is valid returns it in 'result', if not tries to find the next valid
|
||||
//index < length which is valid.
|
||||
bool getNextValidIndex(uint32_t i, uint32_t *result);
|
||||
bool isValidIndex(uint32_t i);
|
||||
|
||||
void destroy();
|
||||
|
@ -17,6 +17,7 @@
|
||||
"helpers.ts",
|
||||
"images.cpp",
|
||||
"basic.cpp",
|
||||
"icons.ts",
|
||||
"input.cpp",
|
||||
"input.ts",
|
||||
"control.ts",
|
||||
@ -37,7 +38,14 @@
|
||||
"_locales/fr/core-jsdoc-strings.json",
|
||||
"_locales/fr/core-strings.json",
|
||||
"_locales/de/core-jsdoc-strings.json",
|
||||
"_locales/de/core-strings.json"
|
||||
"_locales/de/core-strings.json",
|
||||
"_locales/no/core-strings.json",
|
||||
"_locales/ja/core-strings.json",
|
||||
"_locales/sv-SE/core-jsdoc-strings.json",
|
||||
"_locales/no/core-jsdoc-strings.json",
|
||||
"_locales/si-LK/core-strings.json",
|
||||
"_locales/sv-SE/core-strings.json",
|
||||
"_locales/si-LK/core-jsdoc-strings.json"
|
||||
],
|
||||
"public": true,
|
||||
"dependencies": {},
|
||||
@ -50,4 +58,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -51,24 +51,27 @@ namespace serial {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a line of text from the serial port.
|
||||
*/
|
||||
//% help=serial/read-line
|
||||
//% blockId=serial_read_line block="serial|read line"
|
||||
//% weight=20 blockGap=8
|
||||
StringData* readLine() {
|
||||
return readUntil(ManagedString("\n").leakData());
|
||||
* Reads the buffered received data as a string
|
||||
*/
|
||||
//% blockId=serial_read_buffer block="serial|read string"
|
||||
//% weight=18
|
||||
StringData* readString() {
|
||||
int n = uBit.serial.getRxBufferSize();
|
||||
if (n == 0) return ManagedString("").leakData();
|
||||
return ManagedString(uBit.serial.read(n, MicroBitSerialMode::ASYNC)).leakData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an event to be fired when one of the delimiter is matched
|
||||
* @param delimiters the characters to match received characters against. eg:"\n"
|
||||
* Registers an event to be fired when one of the delimiter is matched.
|
||||
* @param delimiters the characters to match received characters against.
|
||||
*/
|
||||
// help=serial/on-data-received
|
||||
// weight=18
|
||||
//% help=serial/on-data-received
|
||||
//% weight=18 blockId=serial_on_data_received block="serial|on data received %delimiters=serial_delimiter_conv"
|
||||
void onDataReceived(StringData* delimiters, Action body) {
|
||||
uBit.serial.eventOn(ManagedString(delimiters));
|
||||
registerWithDal(MICROBIT_ID_SERIAL, MICROBIT_SERIAL_EVT_DELIM_MATCH, body);
|
||||
// lazy initialization of serial buffers
|
||||
uBit.serial.read(MicroBitSerialMode::ASYNC);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,20 +38,20 @@ namespace serial {
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an event to be fired when a line has been received
|
||||
*/
|
||||
// help=serial/on-line-received
|
||||
// blockId=serial_on_line_received block="serial on line received"
|
||||
// weight=21 blockGap=8
|
||||
export function onLineReceived(body: Action): void {
|
||||
// serial.onDataReceived("\n", body);
|
||||
* Reads a line of text from the serial port.
|
||||
*/
|
||||
//% help=serial/read-line
|
||||
//% blockId=serial_read_line block="serial|read line"
|
||||
//% weight=20 blockGap=8
|
||||
export function readLine(): string {
|
||||
return serial.readUntil(delimiters(Delimiters.NewLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the delimiter corresponding string
|
||||
*/
|
||||
//% blockId="serial_delimiter_conv" block="%del"
|
||||
//% weight=1
|
||||
//% weight=1 blockHidden=true
|
||||
export function delimiters(del: Delimiters): string {
|
||||
// even though it might not look like, this is more
|
||||
// (memory) efficient than the C++ implementation, because the
|
||||
|
44
libs/core/shims.d.ts
vendored
@ -40,8 +40,8 @@ declare interface Image {
|
||||
*/
|
||||
//% help=images/show-image weight=80 blockNamespace=images
|
||||
//% blockId=device_show_image_offset block="show image %sprite|at offset %offset" blockGap=8
|
||||
//% parts="ledmatrix" shim=ImageMethods::showImage
|
||||
showImage(xOffset: number): void;
|
||||
//% parts="ledmatrix" async interval.defl=400 shim=ImageMethods::showImage
|
||||
showImage(xOffset: number, interval?: number): void;
|
||||
|
||||
/**
|
||||
* Draws the ``index``-th frame of the image on the screen.
|
||||
@ -118,8 +118,8 @@ declare interface Image {
|
||||
* @param frame TODO
|
||||
*/
|
||||
//% weight=70 help=images/show-frame
|
||||
//% parts="ledmatrix" shim=ImageMethods::showFrame
|
||||
showFrame(frame: number): void;
|
||||
//% parts="ledmatrix" interval.defl=400 shim=ImageMethods::showFrame
|
||||
showFrame(frame: number, interval?: number): void;
|
||||
}
|
||||
|
||||
|
||||
@ -171,7 +171,8 @@ declare namespace basic {
|
||||
*/
|
||||
//% help=basic/clear-screen weight=79
|
||||
//% blockId=device_clear_display block="clear screen"
|
||||
//% parts="ledmatrix" shim=basic::clearScreen
|
||||
//% parts="ledmatrix"
|
||||
//% advanced=true shim=basic::clearScreen
|
||||
function clearScreen(): void;
|
||||
|
||||
/**
|
||||
@ -415,13 +416,15 @@ declare namespace control {
|
||||
/**
|
||||
* Gets a friendly name for the device derived from the its serial number
|
||||
*/
|
||||
//% blockId="control_device_name" block="device name" weight=10 blockGap=8 shim=control::deviceName
|
||||
//% blockId="control_device_name" block="device name" weight=10 blockGap=8
|
||||
//% advanced=true shim=control::deviceName
|
||||
function deviceName(): string;
|
||||
|
||||
/**
|
||||
* Derive a unique, consistent serial number of this device from internal data.
|
||||
*/
|
||||
//% blockId="control_device_serial_number" block="device serial number" weight=9 shim=control::deviceSerialNumber
|
||||
//% blockId="control_device_serial_number" block="device serial number" weight=9
|
||||
//% advanced=true shim=control::deviceSerialNumber
|
||||
function deviceSerialNumber(): number;
|
||||
}
|
||||
|
||||
@ -628,6 +631,16 @@ declare namespace pins {
|
||||
//% blockId=device_set_pull block="set pull|pin %pin|to %pull" shim=pins::setPull
|
||||
function setPull(name: DigitalPin, pull: PinPullMode): void;
|
||||
|
||||
/**
|
||||
* Configures the events emitted by this pin. Events can be subscribed to
|
||||
* using ``control.onEvent()``.
|
||||
* @param name pin to set the event mode on, eg: DigitalPin.P0
|
||||
* @param type the type of events for this pin to emit, eg: PinEventType.Edge
|
||||
*/
|
||||
//% help=pins/set-events weight=4 advanced=true
|
||||
//% blockId=device_set_pin_events block="set pin %pin|to emit %type|events" shim=pins::setEvents
|
||||
function setEvents(name: DigitalPin, type: PinEventType): void;
|
||||
|
||||
/**
|
||||
* Create a new zero-initialized buffer.
|
||||
* @param size number of bytes in the buffer
|
||||
@ -672,12 +685,19 @@ declare namespace serial {
|
||||
function readUntil(delimiter: string): string;
|
||||
|
||||
/**
|
||||
* Reads a line of text from the serial port.
|
||||
* Reads the buffered received data as a string
|
||||
*/
|
||||
//% help=serial/read-line
|
||||
//% blockId=serial_read_line block="serial|read line"
|
||||
//% weight=20 blockGap=8 shim=serial::readLine
|
||||
function readLine(): string;
|
||||
//% blockId=serial_read_buffer block="serial|read string"
|
||||
//% weight=18 shim=serial::readString
|
||||
function readString(): string;
|
||||
|
||||
/**
|
||||
* Registers an event to be fired when one of the delimiter is matched.
|
||||
* @param delimiters the characters to match received characters against.
|
||||
*/
|
||||
//% help=serial/on-data-received
|
||||
//% weight=18 blockId=serial_on_data_received block="serial|on data received %delimiters=serial_delimiter_conv" shim=serial::onDataReceived
|
||||
function onDataReceived(delimiters: string, body: () => void): void;
|
||||
|
||||
/**
|
||||
* Sends a piece of text through Serial connection.
|
||||
|
3
libs/devices/_locales/fr/devices-jsdoc-strings.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"devices": "Contrôler un téléphone avec le BBC micro : bit via Bluetooth."
|
||||
}
|
@ -5,7 +5,8 @@
|
||||
"README.md",
|
||||
"enums.d.ts",
|
||||
"shims.d.ts",
|
||||
"devices.cpp"
|
||||
"devices.cpp",
|
||||
"_locales/fr/devices-jsdoc-strings.json"
|
||||
],
|
||||
"public": true,
|
||||
"dependencies": {
|
||||
@ -13,4 +14,4 @@
|
||||
"bluetooth": "file:../bluetooth"
|
||||
},
|
||||
"installedVersion": "ljipgq"
|
||||
}
|
||||
}
|
24
libs/radio/_locales/de/radio-jsdoc-strings.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"radio": "Daten mithilfe von Funk-Paketen übertragen",
|
||||
"radio.onDataPacketReceived": "Registriert Funktionen, die ausgeführt werden, wenn das Radio ein Datenpaket empfängt. Entnimmt das empfangene Paket aus der Warteschlange des Radios.",
|
||||
"radio.onDataReceived": "Registriert Code der ausgeführt wird, wenn ein Paket über Funk empfangen wird.",
|
||||
"radio.receiveNumber": "Liest das nächste Paket aus der Funk-Warteschlange und gibt die Paketnummer oder 0 aus, wenn das Paket keine Nummer enthält.",
|
||||
"radio.receiveString": "Liest das nächste Paket aus der Funk-Warteschlange und gibt die enthaltene Zeichenfolge oder die leere Zeichenfolge aus, wenn das Paket keine Zeichenfolge enthält.",
|
||||
"radio.receivedNumber": "Extrahiert eine Zahl aus dem Inhalt des letzten Datenpakets, welches aus der Warteschlange des Radios (via ``Zahl empfangen``, ``Zeichenkette empfangen``, etc) entnommen wurde oder eine 0, wenn das Paket keine Zahl enthält.",
|
||||
"radio.receivedSerial": "Extrahiert die Seriennummer des Calliope mini Senders aus dem Inhalt des letzten Datenpakets, welches aus der Warteschlange des Radios entnommen wurde oder eine 0, wenn der Absender keine Seriennummer gesendet hat.",
|
||||
"radio.receivedSignalStrength": "Ruft den empfangenen Signalstärkeindikator (RSSI) aus dem letzten Paket aus der Funk-Warteschlange aus (via ``receiveNumber``, ``receiveString``, etc). Wird im Simulator nicht unterstützt.\nnamespace=radio",
|
||||
"radio.receivedString": "Extrahiert die Zeichenkette aus dem Inhalt des letzten Datenpakets, welches aus der Warteschlange des Radios (via ``Zahl empfangen``, ``Zeichenkette empfangen``, etc) entnommen wurde oder eine leere Zeichenkette, wenn das Paket keine Zeichenkette enthält.",
|
||||
"radio.receivedTime": "Extrahiert die Systemzeit des Absenders aus dem Inhalt des letzten Datenpakets, welches aus der Warteschlange des Radios (via ``Zahl empfangen``, ``Zeichenkette empfangen``, etc) entnommen wurde.",
|
||||
"radio.sendNumber": "Überträgt eine Nummer über Funk an jeden angeschlossenen mini in der Gruppe.",
|
||||
"radio.sendString": "Überträgt eine Zeichenfolge über Funk mit Seriennummer des Geräts und Laufzeit an jeden angeschlossenen mini in der Gruppe.",
|
||||
"radio.sendValue": "Sendet ein Name / Wert-Paar zusammen mit der Seriennummer des Geräts und die Laufzeit auf alle angeschlossenen minis in der Gruppe.",
|
||||
"radio.sendValue|param|name": "die Feldnamen (max. 12 Zeichen), z.B.: \"Daten\"",
|
||||
"radio.sendValue|param|value": "der numerische Wert",
|
||||
"radio.setGroup": "Setzt die Gruppen-ID für Funkverbindungen. Ein mini kann nur ein Gruppen-ID hören.\nDie Gruppen-ID zwischen liegt zwischen 0 und 255, z.B. 1",
|
||||
"radio.setTransmitPower": "Ändere die Ausgabeleistung des Senders auf den angegebenen Wert.",
|
||||
"radio.setTransmitPower|param|power": "ein Wert im Bereich 0.. 7, wo 0 die niedrigste Leistung und 7 ist ist die höchste. z.B. 7",
|
||||
"radio.setTransmitSerialNumber": "Stelle den Dunk so ein, dass die Seriennummer in jeder Nachricht übertragen wird.",
|
||||
"radio.setTransmitSerialNumber|param|transmit": "Wert, der anzeigt, ob die Seriennummer übertragen wird, z.B. wahr",
|
||||
"radio.writeReceivedPacketToSerial": "Schreibt das letzte empfangene Paket als JSON auf Seriell. Sollte in einem ´´onDataPacketReceived``-Callback aufgerufen werden.",
|
||||
"radio.writeValueToSerial": "Liest das nächste Paket aus der Funk-Warteschlange und schreibt dieses als JSON auf Seriell."
|
||||
}
|
17
libs/radio/_locales/de/radio-strings.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"radio.onDataPacketReceived|block": "wenn Datenpaket empfangen",
|
||||
"radio.onDataReceived|block": "über Funk empfangene Daten",
|
||||
"radio.receiveNumber|block": "über Funk empfangene Zahl",
|
||||
"radio.receiveString|block": "über Funk empfangene Zeichenfolge",
|
||||
"radio.receivedSignalStrength|block": "über Funk empfangene Signalstärke",
|
||||
"radio.sendNumber|block": "sende Zahl %value über Funk",
|
||||
"radio.sendString|block": "sende Zeichenfolge %msg über Funk",
|
||||
"radio.sendValue|block": "schicke | Wert %name |=%value über Funk",
|
||||
"radio.setGroup|block": "setze Gruppe %ID über Funk",
|
||||
"radio.setTransmitPower|block": "lege Übertragungsstärke %power über Funk fest",
|
||||
"radio.setTransmitSerialNumber|block": "übertrage Übertragungs-Seriennummer %transmit über Funk",
|
||||
"radio.writeReceivedPacketToSerial|block": "schreibe das über Funk emfangene Paket auf Seriell",
|
||||
"radio.writeValueToSerial|block": "schreibe Wert auf Seriell über Funk",
|
||||
"radio|block": "Funk",
|
||||
"{id:category}Radio": "Funk"
|
||||
}
|
3
libs/radio/_locales/no/radio-jsdoc-strings.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"radio.onDataPacketReceived": "Setter opp kode som skal kjøres når radioen mottar data. Henter mottatte data inn i en variabel."
|
||||
}
|
17
libs/radio/_locales/no/radio-strings.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"radio.onDataPacketReceived|block": "når radio mottar",
|
||||
"radio.onDataReceived|block": "radio når data mottatt",
|
||||
"radio.receiveNumber|block": "radio motta tall",
|
||||
"radio.receiveString|block": "radio motta tekst",
|
||||
"radio.receivedSignalStrength|block": "radio signalstyrke",
|
||||
"radio.sendNumber|block": "radio send tall %value",
|
||||
"radio.sendString|block": "radio send tekst %msg",
|
||||
"radio.sendValue|block": "radio send|verdi %name|= %value",
|
||||
"radio.setGroup|block": "radio sett gruppe %ID",
|
||||
"radio.setTransmitPower|block": "radio sett sendereffekt %power",
|
||||
"radio.setTransmitSerialNumber|block": "radio send alltid serienummer %transmit",
|
||||
"radio.writeReceivedPacketToSerial|block": "radio skriv mottatt pakke til serieport",
|
||||
"radio.writeValueToSerial|block": "radio skriv verdi til serieport",
|
||||
"radio|block": "radio",
|
||||
"{id:category}Radio": "Radio"
|
||||
}
|
4
libs/radio/_locales/si-LK/radio-jsdoc-strings.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"radio": "රේඩියෝ පැකට්ටු යොදා ගෙන දත්ත සන්නිවේදනය",
|
||||
"radio.sendValue|param|value": "සංඛ්යාමය අගය"
|
||||
}
|
16
libs/radio/_locales/si-LK/radio-strings.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"radio.onDataReceived|block": "radio on data received",
|
||||
"radio.receiveNumber|block": "radio receive number",
|
||||
"radio.receiveString|block": "radio receive string",
|
||||
"radio.receivedSignalStrength|block": "radio received signal strength",
|
||||
"radio.sendNumber|block": "radio send number %value",
|
||||
"radio.sendString|block": "radio send string %msg",
|
||||
"radio.sendValue|block": "radio send|value %name|= %value",
|
||||
"radio.setGroup|block": "radio set group %ID",
|
||||
"radio.setTransmitPower|block": "radio set transmit power %power",
|
||||
"radio.setTransmitSerialNumber|block": "radio set transmit serial number %transmit",
|
||||
"radio.writeReceivedPacketToSerial|block": "radio write received packet to serial",
|
||||
"radio.writeValueToSerial|block": "radio write value to serial",
|
||||
"radio|block": "radio",
|
||||
"{id:category}Radio": "රේඩියෝව"
|
||||
}
|
16
libs/radio/_locales/sv-SE/radio-strings.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"radio.onDataReceived|block": "när radion tar emot data",
|
||||
"radio.receiveNumber|block": "när radion tar emot nummer",
|
||||
"radio.receiveString|block": "när radio tar emot sträng",
|
||||
"radio.receivedSignalStrength|block": "när radio tar emot signalstyrka",
|
||||
"radio.sendNumber|block": "radio sänd nummer %value",
|
||||
"radio.sendString|block": "radio sänd sträng %msg",
|
||||
"radio.sendValue|block": "radio sända|värde %name|= %value",
|
||||
"radio.setGroup|block": "radio ställ in grupp %ID",
|
||||
"radio.setTransmitPower|block": "radio ställ in överföringsstyrke %power",
|
||||
"radio.setTransmitSerialNumber|block": "radio ställ in om serienumret sändas %transmit",
|
||||
"radio.writeReceivedPacketToSerial|block": "radio skriv mottagna paketet till seriell",
|
||||
"radio.writeValueToSerial|block": "radio skriv värdet till seriell",
|
||||
"radio|block": "radio",
|
||||
"{id:category}Radio": "Radio"
|
||||
}
|
@ -6,7 +6,14 @@
|
||||
"shims.d.ts",
|
||||
"enums.d.ts",
|
||||
"radio.cpp",
|
||||
"radio.ts"
|
||||
"radio.ts",
|
||||
"_locales/de/radio-strings.json",
|
||||
"_locales/de/radio-jsdoc-strings.json",
|
||||
"_locales/si-LK/radio-strings.json",
|
||||
"_locales/sv-SE/radio-strings.json",
|
||||
"_locales/no/radio-strings.json",
|
||||
"_locales/si-LK/radio-jsdoc-strings.json",
|
||||
"_locales/no/radio-jsdoc-strings.json"
|
||||
],
|
||||
"public": true,
|
||||
"dependencies": {
|
||||
|
@ -24,7 +24,7 @@ using namespace pxt;
|
||||
// payload: string length (9), string (10 ... 28)
|
||||
#define PACKET_TYPE_STRING 2
|
||||
|
||||
//% color=270 weight=34 icon="\uf012"
|
||||
//% color=270 weight=96 icon="\uf012"
|
||||
namespace radio {
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|