Compare commits

...

76 Commits

Author SHA1 Message Date
a7d5804cea 0.7.52 2017-02-01 16:46:58 -08:00
2e5984a65b Bump pxt-core to 0.11.9 2017-02-01 16:46:48 -08:00
c13bef01a4 remove image and move enum 2017-02-01 14:08:23 -08:00
16c08e4c9b 0.7.51 2017-02-01 09:50:31 -08:00
444c37edcb Bump pxt-core to 0.11.8 2017-02-01 09:50:31 -08:00
51781be90b Merge pull request #350 from Microsoft/icons
add icons/arrows/clock
2017-02-01 09:28:09 -08:00
741eb4e4b4 fixed typo in settings 2017-02-01 07:58:20 -08:00
350f595a52 0.7.50 2017-02-01 07:57:21 -08:00
06c392f16f Bump pxt-core to 0.11.7 2017-02-01 07:57:19 -08:00
4bf659c9ac updated translations 2017-02-01 07:57:10 -08:00
db4711fd26 remove hour, add advanced section 2017-01-31 15:54:23 -08:00
8275fefd08 change name 2017-01-31 14:56:56 -08:00
8c474c899c 0.7.49 2017-01-31 08:29:58 -08:00
48bb0e238a Bump pxt-core to 0.11.6 2017-01-31 08:29:56 -08:00
1d47b4de0d Lightmonster (#346)
* fixed boardname issues

* refactored servo info

* coffee cup monster lesson skeleton

* display event source id / value in advanced section

* normalized project structure

* updated project name

* Update projects.md
2017-01-31 08:29:25 -08:00
595e4a23e6 package approval docs (#344)
* updated docs

* @jaustin comments

* Update packages.md
2017-01-31 08:28:33 -08:00
2d3ca71ffb add meta data 2017-01-30 17:05:06 -08:00
3ba9d2867b add attribution 2017-01-30 16:51:40 -08:00
ff7b229a3a add one image to make it spiffy 2017-01-30 16:42:48 -08:00
f944af8122 get rid of images 2017-01-30 15:33:33 -08:00
35225468e4 add some images 2017-01-30 15:03:50 -08:00
72d5e83e5b Exposing pin eventOn method (#349) 2017-01-30 19:19:54 +00:00
436b56a2fa 0.7.48 2017-01-29 22:25:42 -08:00
7a41730f82 Bump pxt-core to 0.11.4 2017-01-29 22:25:41 -08:00
372ddfa641 0.7.47 2017-01-28 22:46:03 -08:00
30078923a3 Bump pxt-core to 0.11.3 2017-01-28 22:46:02 -08:00
5ab9222200 0.7.46 2017-01-28 21:59:48 -08:00
8ae5a48f1e Bump pxt-core to 0.11.2 2017-01-28 21:59:48 -08:00
f9ed37d07b Using pxtsemantic optimization 2017-01-28 21:55:48 -08:00
edfbc4da18 0.7.45 2017-01-28 11:57:24 -08:00
3a1c6a6ce3 Bump pxt-core to 0.11.1 2017-01-28 11:57:22 -08:00
9a4a2264fa Fixing singal strength docs and adding an example (#347) 2017-01-28 19:53:36 +00:00
e9558ce158 Fix svg scaling issue in IE. (#348)
* Fix svg scaling issue in IE. Fixes #1192

* minor fix
2017-01-28 19:53:05 +00:00
50677fadc4 Applying IE/Edge blockly css workaround 2017-01-26 14:47:15 -08:00
649e8f7c0f Fix neopixel transform in firefox (#345) 2017-01-26 02:51:26 +00:00
0cb9c28f8d Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-23 03:54:58 -08:00
004d9b4315 Adding pxt-microbit-GY521 repo 2017-01-23 03:52:53 -08:00
7a5b3aba01 Add hasAudio flag 2017-01-21 16:25:46 -08:00
dc30263642 0.7.44 2017-01-20 15:42:48 -08:00
619658a057 Bump pxt-core to 0.10.15 2017-01-20 15:42:46 -08:00
472846bf3c 0.7.43 2017-01-20 15:16:42 -08:00
ac4fbc850b Bump pxt-core to 0.10.14 2017-01-20 15:16:40 -08:00
c7054b7ee0 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-20 15:16:29 -08:00
559a43e17b 0.7.42 2017-01-20 15:05:50 -08:00
7671bc46ad Bump pxt-core to 0.10.13 2017-01-20 15:05:49 -08:00
b3c5f2926d Electron release 0.7.41 2017-01-20 11:02:59 -08:00
28830aa905 more info on on-start 2017-01-19 17:51:48 -08:00
7fbbb5e65a release of beta 2017-01-19 16:55:20 -08:00
51ebc29887 0.7.41 2017-01-19 16:09:32 -08:00
f5d1722eae Bump pxt-core to 0.10.11 2017-01-19 16:09:29 -08:00
5f876d5ea9 Add openocd script (for pxt gdb) 2017-01-19 17:24:03 +00:00
31de8892fa Use standard type names
otherwise compilation fails on some yotta installs
2017-01-19 17:23:51 +00:00
0d0a68122d 0.7.40 2017-01-19 00:19:15 -08:00
4ad660568e Bump pxt-core to 0.10.10 2017-01-19 00:19:14 -08:00
58e82a571d 0.7.39 2017-01-18 16:14:11 -08:00
e629b866d5 Merge branch 'master' of https://github.com/Microsoft/pxt-microbit 2017-01-18 16:13:08 -08:00
f0ac2b7a05 fixing debug message 2017-01-18 16:12:58 -08:00
e3c8db28e4 0.7.38 2017-01-18 14:48:43 -08:00
2c0e19a120 Bump pxt-core to 0.10.9 2017-01-18 14:48:42 -08:00
595eb788b2 removed console.log for pxt.debug 2017-01-17 16:51:21 -08:00
2e15d22e9e 0.7.37 2017-01-17 16:29:52 -08:00
57082654a9 0.7.36 2017-01-17 14:55:44 -08:00
8cbf7d38e3 0.7.35 2017-01-17 14:51:28 -08:00
a99a7325bf 0.7.34 2017-01-17 14:13:06 -08:00
fa3ed9dd21 0.7.33 2017-01-17 11:37:35 -08:00
45fd40a553 adding on pin pressed in getting-started 2017-01-17 11:37:20 -08:00
5a18bea9eb 0.7.32 2017-01-17 11:28:38 -08:00
d310312841 Bump pxt-core to 0.10.8 2017-01-17 11:28:35 -08:00
a4b93f7199 support for deletable on start 2017-01-17 11:18:22 -08:00
538a4b7bbf 0.7.31 2017-01-13 18:11:03 -08:00
0078e7bc12 Bump pxt-core to 0.10.7 2017-01-13 18:11:02 -08:00
d2726133a9 Revert "Control event value in simulator (#343)"
This reverts commit 00f4c9cbb3.
2017-01-13 18:04:38 -08:00
00f4c9cbb3 Control event value in simulator (#343)
* implement pxsim.control.eventValue and pxsim.control.eventTimestamp in the simulator
2017-01-13 16:46:52 -08:00
e15da5dee1 0.7.30 2017-01-13 15:47:16 -08:00
85dda4ea84 Bump pxt-core to 0.10.4 2017-01-13 15:47:15 -08:00
a3ffe4e1cf Set latest Electron to 0.7.29 (#342) 2017-01-13 14:11:46 -08:00
74 changed files with 1611 additions and 146 deletions

View File

@ -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
View 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.

View File

@ -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

View File

@ -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){}

View File

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

View File

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

View File

@ -1,3 +1,3 @@
{
"appref": "v0.6.36"
"appref": "v0.7.41"
}

View File

@ -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

View File

@ -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)

View File

@ -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!

View File

@ -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!

View File

@ -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
### ~

View 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!
### ~

View 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
### ~

View 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
```

View 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
### ~

View File

@ -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

View File

@ -1,4 +1,4 @@
# hack your headphones - music of light
# Code
### ~avatar avatar

View File

@ -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

View File

@ -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
![Materials](/static/mb/projects/inchworm/materials.jpg)
## 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!

View File

@ -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
### ~

View 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
```

View File

@ -1,4 +1,4 @@
# Chassis
# Make
### @description Building the cardboard inchworm
### ~avatar avatar

View File

@ -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!

View File

@ -1,4 +1,4 @@
# telegraph - manual telegraph
# Code
Let's build the code that will send a impulse while the user presses ``A``.

View File

@ -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
![](/static/mb/lessons/telegraph-0.png)
### ~button /projects/telegraph/manual-telegraph
### ~button /projects/telegraph/code
NEXT: manual telegraph
NEXT: Code
### ~

View File

@ -1,4 +1,4 @@
# Wallet - Code
# Code
## Simple animation

View File

@ -1,4 +1,4 @@
# Wallet - Make
# Make
### @description Maker Project for Wallet

View File

@ -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

View File

@ -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

View File

@ -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

View 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/)

View File

@ -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),

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -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

View File

@ -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

View File

@ -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))
})
```

View File

@ -1,9 +1,9 @@
{
"versions": {
"0": {
"latest": "v0.7.23",
"latest": "v0.7.41",
"banned": [],
"prompt": "v1.0.0"
"prompt": "v0.7.41"
}
}
}

View File

@ -1,3 +1,4 @@
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="pxt-on-start"></block>
<block type="device_forever"></block>
</xml>

View File

@ -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",

View File

@ -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",

View File

@ -55,6 +55,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 +114,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",
@ -92,6 +136,7 @@
"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 +212,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",

View File

@ -186,7 +186,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",

View File

@ -115,6 +115,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",

View File

@ -5,5 +5,10 @@
"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.showLeds|param|interval": "pause i millisekunder etter visning",
"basic.showLeds|param|leds": "mønsteret som skal vises med lysdiodene",
"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!\""
}

View File

@ -1,3 +1,9 @@
{
"String.charAt|block": "tegn fra %this|på plass %pos",
"String.concat|block": "sett sammen %this|%other",
"String.isEmpty|block": "%this| er tom",
"basic.clearScreen|block": "tøm skjermen",
"basic.showLeds|block": "vis bilde",
"basic.showString|block": "vis|tekst %text",
"serial|block": "føljetong"
}

View File

@ -0,0 +1,6 @@
{
"Math.randomBoolean": "සත්‍යය හෝ අසත්‍යය අගයන් අහඹු ලෙස ලැබෙනවා. කාසියක් උඩ දාපුවම ලැබෙන අගයන් දෙක වගේ.",
"String.fromCharCode": "දෙන ලද ASCII අක්ෂර කේතයෙන් වචනයක් සකසන්න.",
"basic": "මුලික micro:bit අංග වලට ප්‍රවේශ වීමට ඉඩ කඩ ලබා දෙයි.",
"basic.clearScreen": "සියලුම LEDs නිවා දමන්න"
}

View 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"
}

View File

@ -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"
}

View 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"
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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;
}

16
libs/core/enums.d.ts vendored
View File

@ -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
@ -297,6 +301,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

608
libs/core/icons.ts Normal file
View File

@ -0,0 +1,608 @@
/*
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 {
const heart = `
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`
const small_heart = `
. . . . .
. # . # .
. # # # .
. . # . .
. . . . .`
//faces
const happy_face = `
. . . . .
. # . # .
. . . . .
# . . . #
. # # # .`
const sad_face = `
. . . . .
. # . # .
. . . . .
. # # # .
# . . . #`
const confused_face = `
. . . . .
. # . # .
. . . . .
. # . # .
# . # . #`
const angry_face = `
# . . . #
. # . # .
. . . . .
# # # # #
# . # . #`
const asleep_face = `
. . . . .
# # . # #
. . . . .
. # # # .
. . . . .`
const surprised_face = `
. # . # .
. . . . .
. . # . .
. # . # .
. . # . .`
const silly_face = `
# . . . #
. . . . .
# # # # #
. . . # #
. . . # #`
const fabulous_face = `
# # # # #
# # . # #
. . . . .
. # . # .
. # # # .`
const meh_face = `
# # . # #
. . . . .
. . . # .
. . # . .
. # . . .`
const yes = `
. . . . .
. . . . #
. . . # .
# . # . .
. # . . .`
const no = `
# . . . #
. # . # .
. . # . .
. # . # .
# . . . #`
// compass directions
const arrow_n = `
. . # . .
. # # # .
# . # . #
. . # . .
. . # . .`
const arrow_ne = `
. . # # #
. . . # #
. . # . #
. # . . .
# . . . .`
const arrow_e = `
. . # . .
. . . # .
# # # # #
. . . # .
. . # . .`
const arrow_se = `
# . . . .
. # . . .
. . # . #
. . . # #
. . # # #`
const arrow_s = `
. . # . .
. . # . .
# . # . #
. # # # .
. . # . .`
const arrow_sw = `
. . . . #
. . . # .
# . # . .
# # . . .
# # # . .`
const arrow_w = `
. . # . .
. # . . .
# # # # #
. # . . .
. . # . .`
const arrow_nw = `
# # # . .
# # . . .
# . # . .
. . . # .
. . . . #`
// geometry
const triangle = `
. . . . .
. . # . .
. # . # .
# # # # #
. . . . .`
const left_triangle = `
# . . . .
# # . . .
# . # . .
# . . # .
# # # # #`
const chessboard = `
. # . # .
# . # . #
. # . # .
# . # . #
. # . # .`
const diamond = `
. . # . .
. # . # .
# . . . #
. # . # .
. . # . .`
const small_diamond = `
. . . . .
. . # . .
. # . # .
. . # . .
. . . . .`
const square = `
# # # # #
# . . . #
# . . . #
# . . . #
# # # # #`
const small_square = `
. . . . .
. # # # .
. # . # .
. # # # .
. . . . .`
// The following images were designed by Abbie Brooks.
const tshirt = `
# # . # #
# # # # #
. # # # .
. # # # .
. # # # .`
const rollerskate = `
. . . # #
. . . # #
# # # # #
# # # # #
. # . # .`
const duck = `
. # # . .
# # # . .
. # # # #
. # # # .
. .. . .`
const house = `
. . # . .
. # # # .
# # # # #
. # # # .
. # . # .`
const tortoise = `
. . . . .
. # # # .
# # # # #
. # . # .
. . . . .`
const butterfly = `
# # . # #
# # # # #
. . # . .
# # # # #
# # . # #`
const stick_figure = `
. . # . .
# # # # #
. . # . .
. # . # .
# . . . #`
const ghost = `
. # # # .
# . # . #
# # # # #
# # # # #
# . # . #`
const sword = `
. . # . .
. . # . .
. . # . .
. # # # .
. . # . .`
const giraffe = `
# # . . .
. # . . .
. # . . .
. # # # .
. # . # .`
const skull = `
. # # # .
# . # . #
# # # # #
. # # # .
. # # # .`
const umbrella = `
. # # # .
# # # # #
. . # . .
# . # . .
# # # . .`
const snake = `
# # . . .
# # . # #
. # . # .
. # # # .
. . . . .`
// animals
const rabbit = `
# . # . .
# . # . .
# # # # .
# # . # .
# # # # .`
const cow = `
# . . . #
# . . . #
# # # # #
. # # # .
. . # . .`
// musical notes
const quarter_note = `
. . # . .
. . # . .
. . # . .
# # # . .
# # # . .`
const eigth_note = `
. . # . .
. . # # .
. . # . #
# # # . .
# # # . .`
// other icons
const pitchfork = `
# . # . #
# . # . #
# # # # #
. . # . .
. . # . .`
const pacman = `
. # # # #
# # # # .
# # # . .
# # # # .
. # # # #`
const target = `
. . # . .
. # # # .
# # . # #
. # # # .
. . # . .`
//% 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(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
switch (i) {
case ArrowNames.North: return set(res, arrow_n)
case ArrowNames.NorthEast: return set(res, arrow_ne)
case ArrowNames.East: return set(res, arrow_e)
case ArrowNames.SouthEast: return set(res, arrow_se)
case ArrowNames.South: return set(res, arrow_s)
case ArrowNames.SouthWest: return set(res, arrow_sw)
case ArrowNames.West: return set(res, arrow_w)
case ArrowNames.NorthWest: return set(res, arrow_nw)
}
return res;
}
//% weight=50 blockGap=8
//% blockId=builtin_image block="icon image %i"
export function iconImage(i: IconNames): Image {
let res = images.createImage(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
switch (i) {
case IconNames.Heart: return set(res, heart)
case IconNames.SmallHeart: return set(res, small_heart)
case IconNames.Yes: return set(res, yes)
case IconNames.No: return set(res, no)
case IconNames.Happy: return set(res, happy_face)
case IconNames.Sad: return set(res, sad_face)
case IconNames.Confused: return set(res, confused_face)
case IconNames.Angry: return set(res, angry_face)
case IconNames.Asleep: return set(res, asleep_face)
case IconNames.Surprised: return set(res, surprised_face)
case IconNames.Silly: return set(res, silly_face)
case IconNames.Fabulous: return set(res, fabulous_face)
case IconNames.Meh: return set(res, meh_face)
case IconNames.TShirt: return set(res, tshirt)
case IconNames.Rollerskate: return set(res, rollerskate)
case IconNames.Duck: return set(res, duck)
case IconNames.House: return set(res, house)
case IconNames.Tortoise: return set(res, tortoise)
case IconNames.Butterfly: return set(res, butterfly)
case IconNames.StickFigure: return set(res, stick_figure)
case IconNames.Ghost: return set(res, ghost)
case IconNames.Sword: return set(res, sword)
case IconNames.Giraffe: return set(res, giraffe)
case IconNames.Skull: return set(res, skull)
case IconNames.Umbrella: return set(res, umbrella)
case IconNames.Snake: return set(res, snake)
case IconNames.Rabbit: return set(res, rabbit)
case IconNames.Cow: return set(res, cow)
case IconNames.QuarterNote: return set(res, quarter_note)
case IconNames.EigthNote: return set(res, eigth_note)
case IconNames.Pitchfork: return set(res, pitchfork)
case IconNames.Pacman: return set(res, pacman)
case IconNames.Target: return set(res, target)
case IconNames.Triangle: return set(res, triangle)
case IconNames.LeftTriangle: return set(res, left_triangle)
case IconNames.Chessboard: return set(res, chessboard)
case IconNames.Diamond: return set(res, diamond)
case IconNames.SmallDiamond: return set(res, small_diamond)
case IconNames.Square: return set(res, square)
case IconNames.SmallSquare: return set(res, small_square)
}
return res;
}
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
}
}

View File

@ -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;
}

View File

@ -47,6 +47,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 +118,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 +127,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 +139,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 +150,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 +165,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 +185,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 +193,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 +217,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 +228,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 +241,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 +252,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 +261,7 @@ namespace pins {
pitchPin->setAnalogValue(512);
pitchPin->setAnalogPeriodUs(1000000/frequency);
}
if (ms > 0) {
fiber_sleep(ms);
pitchPin->setAnalogValue(0);
@ -259,7 +270,7 @@ namespace pins {
}
}
/**
* Configures the pull of this pin.
* @param name pin to set the pull mode on, eg: DigitalPin.P0
@ -268,13 +279,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 +318,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 +345,5 @@ namespace pins {
auto p = allocSPI();
return p->write(value);
}
}

View File

@ -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");
}

View File

@ -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": {},

19
libs/core/shims.d.ts vendored
View File

@ -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

View 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."
}

View File

@ -0,0 +1,3 @@
{
"radio.onDataPacketReceived|block": "når radio mottar"
}

View File

@ -0,0 +1,4 @@
{
"radio": "රේඩියෝ පැකට්ටු යොදා ගෙන දත්ත සන්නිවේදනය",
"radio.sendValue|param|value": "සංඛ්‍යාමය අගය"
}

View 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": "රේඩියෝව"
}

View 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"
}

View File

@ -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": {

View File

@ -1,6 +1,6 @@
{
"name": "pxt-microbit",
"version": "0.7.29",
"version": "0.7.52",
"description": "micro:bit target for PXT",
"keywords": [
"JavaScript",
@ -36,6 +36,6 @@
"semantic-ui-less": "^2.2.4"
},
"dependencies": {
"pxt-core": "0.10.2"
"pxt-core": "0.11.9"
}
}

View File

@ -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",
@ -72,7 +73,8 @@
"logicBlocks": true,
"variablesBlocks": true,
"onStartColor": "#0078D7",
"onStartNamespace": "basic"
"onStartNamespace": "basic",
"onStartWeight": 54
},
"simulator": {
"autoRun": true,
@ -328,6 +330,7 @@
"invertedMenu": true,
"coloredToolbox": true,
"monacoToolbox": true,
"hasAudio": true,
"blocklyOptions": {
"grid": {
"spacing": 45,
@ -337,4 +340,4 @@
}
}
}
}
}

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -5,7 +5,8 @@
"microbit-foundation"
],
"approvedRepos": [
"CoderDojoOlney/pxt-olney"
"CoderDojoOlney/pxt-olney",
"PaulDFoster/pxt-microbit-GY521"
]
}
}

View File

@ -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';
@ -45,7 +45,7 @@
Blockly
*******************************/
.blocklyTreeRow {
div.blocklyTreeRow {
border-bottom: 1px solid #ecf0f1 !important;
margin-bottom: 0px !important;
@ -56,7 +56,7 @@
}
/* Blockly toolbox font size same as the page font */
.blocklyTreeLabel {
span.blocklyTreeLabel {
font-family: @pageFont !important;
font-weight: 200;
}