Compare commits
142 Commits
Author | SHA1 | Date | |
---|---|---|---|
652b09d5c4 | |||
e35312de70 | |||
82764ffcc1 | |||
f1404cef61 | |||
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 |
2
.vscode/settings.json
vendored
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
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
|
||||
@ -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
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
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
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
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
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
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
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
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
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
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
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!
|
||||
|
||||
|
@ -30,23 +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)
|
||||
})
|
||||
```
|
||||
|
||||
```package
|
||||
radio
|
||||
```
|
||||
### ~button /projects/inchworm/connect
|
||||
NEXT: Connect
|
||||
### ~
|
28
docs/projects/inchworm/connect.md
Normal file
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](/blocks/logic/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](/blocks/logic/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](/blocks/logic/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
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
|
||||
|
BIN
docs/static/blocks/iconnames/heart.PNG
vendored
Normal file
BIN
docs/static/blocks/iconnames/heart.PNG
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
3
docs/static/logo.square.black.svg
vendored
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
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 |
@ -31,6 +31,7 @@ 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, () => {
|
||||
@ -59,3 +60,15 @@ input.onGesture(Gesture.Shake, () => {
|
||||
`)
|
||||
})
|
||||
```
|
||||
|
||||
### 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
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,8 @@
|
||||
"shims.d.ts",
|
||||
"bluetooth.ts",
|
||||
"bluetooth.cpp",
|
||||
"_locales/de/bluetooth-jsdoc-strings.json"
|
||||
"_locales/de/bluetooth-jsdoc-strings.json",
|
||||
"_locales/no/bluetooth-strings.json"
|
||||
],
|
||||
"public": true,
|
||||
"dependencies": {
|
||||
|
@ -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",
|
||||
|
@ -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,6 +223,7 @@
|
||||
"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",
|
||||
|
@ -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",
|
||||
@ -186,7 +187,6 @@
|
||||
"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",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"AcceleratorRange.OneG|block": "1g",
|
||||
"AcceleratorRange.TwoG": "Der Bewegungssensor misst Kräfte bis 2g",
|
||||
"AcceleratorRange.TwoG|block": "2g",
|
||||
"BaudRate.BaudRate115200|block": "11520",
|
||||
"BaudRate.BaudRate115200|block": "115200",
|
||||
"BaudRate.BaudRate9600|block": "9600",
|
||||
"BeatFraction.Eighth|block": "1/8",
|
||||
"BeatFraction.Half|block": "1/2",
|
||||
@ -72,13 +72,8 @@
|
||||
"PinPullMode.PullUp|block": "nach oben",
|
||||
"Rotation.Pitch|block": "Winkel",
|
||||
"Rotation.Roll|block": "rollen",
|
||||
"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",
|
||||
"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",
|
||||
@ -115,6 +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.onPinReleased|block": "wenn Pin %NAME|losgelassen",
|
||||
"input.pinIsPressed|block": "Pin %NAME|ist gedrückt",
|
||||
"input.rotation|block": "Rotation (°)|%NAME",
|
||||
@ -157,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",
|
||||
|
@ -20,6 +20,13 @@
|
||||
"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": "ボードを落としたときに発生します。",
|
||||
@ -42,9 +49,60 @@
|
||||
"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": "ずっと",
|
||||
@ -55,6 +113,7 @@
|
||||
"basic|block": "基本",
|
||||
"control.inBackground|block": "バックグラウンドで実行する",
|
||||
"control.reset|block": "リセット",
|
||||
"control.waitMicros|block": "ひと休み(マイクロ秒) %micros",
|
||||
"control|block": "制御",
|
||||
"game.gameOver|block": "ゲームオーバー",
|
||||
"game|block": "ゲーム",
|
||||
@ -62,6 +121,9 @@
|
||||
"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|がタッチされている",
|
||||
@ -72,11 +134,22 @@
|
||||
"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}Math": "計算",
|
||||
"{id:category}Music": "音楽",
|
||||
"{id:category}Pins": "入出力端子",
|
||||
"{id:category}Serial": "シリアル通信"
|
||||
}
|
@ -5,5 +5,45 @@
|
||||
"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.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."
|
||||
}
|
@ -1,3 +1,197 @@
|
||||
{
|
||||
"serial|block": "føljetong"
|
||||
"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
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
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"
|
||||
}
|
@ -1,5 +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.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
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;
|
||||
}
|
||||
|
||||
//%
|
||||
|
42
libs/core/enums.d.ts
vendored
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
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -338,10 +338,10 @@ 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");
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
"helpers.ts",
|
||||
"images.cpp",
|
||||
"basic.cpp",
|
||||
"icons.ts",
|
||||
"input.cpp",
|
||||
"input.ts",
|
||||
"control.ts",
|
||||
@ -41,7 +42,10 @@
|
||||
"_locales/no/core-strings.json",
|
||||
"_locales/ja/core-strings.json",
|
||||
"_locales/sv-SE/core-jsdoc-strings.json",
|
||||
"_locales/no/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": {},
|
||||
|
27
libs/core/shims.d.ts
vendored
27
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
|
||||
|
3
libs/radio/_locales/no/radio-jsdoc-strings.json
Normal file
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
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
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
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
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"
|
||||
}
|
@ -8,7 +8,12 @@
|
||||
"radio.cpp",
|
||||
"radio.ts",
|
||||
"_locales/de/radio-strings.json",
|
||||
"_locales/de/radio-jsdoc-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": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-microbit",
|
||||
"version": "0.7.23",
|
||||
"version": "0.9.8",
|
||||
"description": "micro:bit target for PXT",
|
||||
"keywords": [
|
||||
"JavaScript",
|
||||
@ -36,6 +36,6 @@
|
||||
"semantic-ui-less": "^2.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"pxt-core": "0.8.13"
|
||||
"pxt-core": "0.11.36"
|
||||
}
|
||||
}
|
||||
|
@ -14,8 +14,8 @@
|
||||
"cloud": {
|
||||
"workspace": false,
|
||||
"packages": true,
|
||||
"sharing": false,
|
||||
"publish": false,
|
||||
"sharing": true,
|
||||
"publishing": true,
|
||||
"preferredPackages": [
|
||||
"Microsoft/pxt-neopixel",
|
||||
"Microsoft/pxt-filesystem"
|
||||
@ -28,6 +28,7 @@
|
||||
"deployDrives": "(MICROBIT|MBED)",
|
||||
"driveName": "MICROBIT",
|
||||
"hexMimeType": "application/x-microbit-hex",
|
||||
"openocdScript": "source [find interface/cmsis-dap.cfg]; source [find target/nrf51.cfg]",
|
||||
"upgrades": [
|
||||
{
|
||||
"type": "package",
|
||||
@ -71,8 +72,10 @@
|
||||
"loopsBlocks": true,
|
||||
"logicBlocks": true,
|
||||
"variablesBlocks": true,
|
||||
"textBlocks": true,
|
||||
"onStartColor": "#0078D7",
|
||||
"onStartNamespace": "basic"
|
||||
"onStartNamespace": "basic",
|
||||
"onStartWeight": 54
|
||||
},
|
||||
"simulator": {
|
||||
"autoRun": true,
|
||||
@ -205,6 +208,7 @@
|
||||
"termsOfUseUrl": "https://go.microsoft.com/fwlink/?LinkID=206977",
|
||||
"githubUrl": "https://github.com/Microsoft/pxt-microbit",
|
||||
"projectGallery": "projects",
|
||||
"exampleGallery": "examples",
|
||||
"crowdinProject": "kindscript",
|
||||
"boardName": "micro:bit",
|
||||
"sideDoc": "tutorials/getting-started",
|
||||
@ -328,6 +332,7 @@
|
||||
"invertedMenu": true,
|
||||
"coloredToolbox": true,
|
||||
"monacoToolbox": true,
|
||||
"hasAudio": true,
|
||||
"blocklyOptions": {
|
||||
"grid": {
|
||||
"spacing": 45,
|
||||
@ -337,4 +342,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ namespace pxsim {
|
||||
radioState: RadioState;
|
||||
// TODO: not singletons
|
||||
neopixelState: NeoPixelState;
|
||||
servosState: MicroServosState;
|
||||
fileSystem: FileSystemState;
|
||||
|
||||
constructor() {
|
||||
@ -53,7 +52,13 @@ namespace pxsim {
|
||||
0,
|
||||
DAL.MICROBIT_ID_IO_P19,
|
||||
DAL.MICROBIT_ID_IO_P20
|
||||
]
|
||||
],
|
||||
servos: {
|
||||
"P0": DAL.MICROBIT_ID_IO_P0,
|
||||
"P1": DAL.MICROBIT_ID_IO_P1,
|
||||
"P2": DAL.MICROBIT_ID_IO_P2,
|
||||
"P3": DAL.MICROBIT_ID_IO_P3
|
||||
}
|
||||
});
|
||||
this.builtinParts["radio"] = this.radioState = new RadioState(runtime);
|
||||
this.builtinParts["accelerometer"] = this.accelerometerState = new AccelerometerState(runtime);
|
||||
@ -62,12 +67,7 @@ namespace pxsim {
|
||||
this.builtinParts["lightsensor"] = this.lightSensorState = new LightSensorState();
|
||||
this.builtinParts["compass"] = this.compassState = new CompassState();
|
||||
this.builtinParts["neopixel"] = this.neopixelState = new NeoPixelState();
|
||||
this.builtinParts["microservo"] = this.servosState = new MicroServosState({
|
||||
"P0": DAL.MICROBIT_ID_IO_P0,
|
||||
"P1": DAL.MICROBIT_ID_IO_P1,
|
||||
"P2": DAL.MICROBIT_ID_IO_P2,
|
||||
"P3": DAL.MICROBIT_ID_IO_P3
|
||||
});
|
||||
this.builtinParts["microservo"] = this.edgeConnectorState;
|
||||
|
||||
this.builtinVisuals["buttonpair"] = () => new visuals.ButtonPairView();
|
||||
this.builtinVisuals["ledmatrix"] = () => new visuals.LedMatrixView();
|
||||
|
@ -76,8 +76,7 @@ namespace pxsim.pins {
|
||||
if (!pin) return;
|
||||
|
||||
analogSetPeriod(pinId, 20000);
|
||||
const state = board().servosState.servoState(pinId);
|
||||
state.setAngle(value);
|
||||
pin.servoAngle = value;
|
||||
}
|
||||
|
||||
export function servoSetPulse(pinId: number, micros: number) {
|
||||
|
@ -28,7 +28,7 @@ namespace pxsim {
|
||||
this.data = data;
|
||||
}
|
||||
public print() {
|
||||
console.log(`Image id:${this.id} refs:${this.refcnt} size:${this.width}x${Image.height}`)
|
||||
// console.debug(`Image id:${this.id} refs:${this.refcnt} size:${this.width}x${Image.height}`)
|
||||
}
|
||||
public get(x: number, y: number): number {
|
||||
if (x < 0 || x >= this.width || y < 0 || y >= 5) return 0;
|
||||
@ -129,10 +129,11 @@ namespace pxsim.images {
|
||||
}
|
||||
|
||||
namespace pxsim.ImageMethods {
|
||||
export function showImage(leds: Image, offset: number) {
|
||||
export function showImage(leds: Image, offset: number, interval: number) {
|
||||
pxtrt.nullCheck(leds)
|
||||
leds.copyTo(offset, 5, board().ledMatrixState.image, 0)
|
||||
runtime.queueDisplayUpdate()
|
||||
basic.pause(interval);
|
||||
}
|
||||
|
||||
export function plotImage(leds: Image, offset: number): void {
|
||||
@ -155,8 +156,8 @@ namespace pxsim.ImageMethods {
|
||||
ImageMethods.plotImage(leds, frame * Image.height);
|
||||
}
|
||||
|
||||
export function showFrame(leds: Image, frame: number) {
|
||||
ImageMethods.showImage(leds, frame * Image.height);
|
||||
export function showFrame(leds: Image, frame: number, interval: number) {
|
||||
ImageMethods.showImage(leds, frame * Image.height, interval);
|
||||
}
|
||||
|
||||
export function pixel(leds: Image, x: number, y: number): number {
|
||||
@ -228,7 +229,7 @@ namespace pxsim.basic {
|
||||
clearScreen();
|
||||
pause(interval * 5);
|
||||
} else {
|
||||
if (s.length == 1) showLeds(createImageFromString(s + " "), interval * 5)
|
||||
if (s.length == 1) showLeds(createImageFromString(s), 0);
|
||||
else ImageMethods.scrollImage(createImageFromString(s + " "), 1, interval);
|
||||
}
|
||||
}
|
||||
|
@ -119,6 +119,9 @@ namespace pxsim.pins {
|
||||
export function getPinAddress(name: number) {
|
||||
return getPin(name)
|
||||
}
|
||||
|
||||
export function setEvents(name: number, event: number) {
|
||||
}
|
||||
}
|
||||
|
||||
namespace pxsim.devices {
|
||||
|
@ -179,6 +179,7 @@ namespace pxsim.visuals {
|
||||
.sim-neopixel-canvas-parent:hover {
|
||||
transform-origin: center;
|
||||
transform: scale(4) translateY(-60px);
|
||||
-moz-transform: scale(4) translateY(-220px);
|
||||
}
|
||||
.sim-neopixel-canvas .hidden {
|
||||
visibility:hidden;
|
||||
|
@ -5,7 +5,8 @@
|
||||
"microbit-foundation"
|
||||
],
|
||||
"approvedRepos": [
|
||||
"CoderDojoOlney/pxt-olney"
|
||||
"CoderDojoOlney/pxt-olney",
|
||||
"PaulDFoster/pxt-microbit-GY521"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,56 +1,3 @@
|
||||
/*******************************
|
||||
Site Overrides
|
||||
*******************************/
|
||||
|
||||
.ui.loader:before {
|
||||
border: none;
|
||||
border-radius: 0px;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.ui.loader:after {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0px;
|
||||
margin: 40px auto;
|
||||
background: transparent data-uri("static/loader.svg") no-repeat center center;
|
||||
background-size: 100%;
|
||||
-webkit-animation: loader-pxt @loaderSpeed infinite ease-in-out;
|
||||
animation: loader-pxt @loaderSpeed infinite ease-in-out;
|
||||
}
|
||||
|
||||
@-webkit-keyframes loader-pxt {
|
||||
0% {
|
||||
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(0deg);
|
||||
transform: perspective(160px) rotateX(0deg) rotateY(0deg);
|
||||
opacity: 0}
|
||||
15% {
|
||||
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(-@loaderAngle);
|
||||
transform: perspective(160px) rotateX(0deg) rotateY(-@loaderAngle); }
|
||||
50% {
|
||||
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(@loaderAngle);
|
||||
transform: perspective(160px) rotateX(0deg) rotateY(@loaderAngle);
|
||||
opacity: 1}
|
||||
100% {
|
||||
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(0deg);
|
||||
transform: perspective(160px) rotateX(0deg) rotateY(0deg);
|
||||
opacity: 0}
|
||||
}
|
||||
|
||||
@keyframes loader-pxt {
|
||||
0% {
|
||||
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(0deg);
|
||||
transform: perspective(160px) rotateX(0deg) rotateY(0deg);
|
||||
opacity: 0}
|
||||
15% {
|
||||
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(-10deg);
|
||||
transform: perspective(160px) rotateX(0deg) rotateY(-10deg); }
|
||||
50% {
|
||||
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(10deg);
|
||||
transform: perspective(160px) rotateX(0deg) rotateY(10deg);
|
||||
opacity: 1}
|
||||
100% {
|
||||
-webkit-transform: perspective(160px) rotateX(0deg) rotateY(0deg);
|
||||
transform: perspective(160px) rotateX(0deg) rotateY(0deg);
|
||||
opacity: 0}
|
||||
}
|
@ -1,8 +1,3 @@
|
||||
/*******************************
|
||||
User Variable Overrides
|
||||
*******************************/
|
||||
|
||||
@loaderSpeed: 2s;
|
||||
@loaderAngle: 5deg;
|
||||
|
||||
@large : 200px;
|
@ -1,5 +1,5 @@
|
||||
/* Import all components */
|
||||
@import 'semantic';
|
||||
@import 'pxtsemantic';
|
||||
@import 'pxt';
|
||||
@import 'themes/default/globals/site.variables';
|
||||
@import 'themes/pxt/globals/site.variables';
|
||||
@ -29,15 +29,23 @@
|
||||
&:extend(.orange all);
|
||||
}
|
||||
|
||||
.ui.button.editortools-btn {
|
||||
&:extend(.blue all);
|
||||
}
|
||||
|
||||
#filelist, #editortools {
|
||||
background: #fff url(https://az742082.vo.msecnd.net/pub/psopafpj) 0 0 repeat !important;
|
||||
}
|
||||
|
||||
#downloadArea {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
/*******************************
|
||||
Blockly
|
||||
*******************************/
|
||||
|
||||
.blocklyTreeRow {
|
||||
div.blocklyTreeRow {
|
||||
border-bottom: 1px solid #ecf0f1 !important;
|
||||
margin-bottom: 0px !important;
|
||||
|
||||
@ -48,7 +56,7 @@
|
||||
}
|
||||
|
||||
/* Blockly toolbox font size same as the page font */
|
||||
.blocklyTreeLabel {
|
||||
span.blocklyTreeLabel {
|
||||
font-family: @pageFont !important;
|
||||
font-weight: 200;
|
||||
}
|
||||
|
Reference in New Issue
Block a user