Compare commits

...

56 Commits

Author SHA1 Message Date
Peli de Halleux
566b750419 0.9.6 2017-02-14 07:44:30 -08:00
Peli de Halleux
b119952e75 Bump pxt-core to 0.11.33 2017-02-14 07:44:28 -08:00
Peli de Halleux
e4e6a5effd updated translations 2017-02-14 07:39:09 -08:00
Peli de Halleux
ec1117842d 0.9.5 2017-02-13 15:36:12 -08:00
Peli de Halleux
de4242bf71 Bump pxt-core to 0.11.32 2017-02-13 15:36:10 -08:00
Peli de Halleux
59322fb06b updated strings 2017-02-11 14:05:02 -08:00
Abhijith Chatra
19e609c245 Delay initializing the global icons (#354)
* delay initializing the global icons, so we don't generate them for each hex file

* Moving the strings to flash
2017-02-10 16:33:52 -08:00
Peli de Halleux
a5cb663316 0.9.4 2017-02-09 22:52:07 -08:00
Peli de Halleux
1dd0c1793e Bump pxt-core to 0.11.28 2017-02-09 22:52:05 -08:00
Peli de Halleux
a4a74bdd6b adding a few more examples 2017-02-09 17:40:21 -08:00
Peli de Halleux
45c82767d0 fixed titles 2017-02-09 14:57:38 -08:00
Peli de Halleux
0c77927f35 fixing example page format 2017-02-09 14:51:12 -08:00
Peli de Halleux
672672e632 adding example pages 2017-02-09 14:44:56 -08:00
Peli de Halleux
fe2ae855b0 0.9.3 2017-02-09 11:02:28 -08:00
Peli de Halleux
6612080885 Bump pxt-core to 0.11.27 2017-02-09 11:02:26 -08:00
Peli de Halleux
8641a81e05 0.9.2 2017-02-08 21:09:06 -08:00
Peli de Halleux
656e183a1a Bump pxt-core to 0.11.26 2017-02-08 21:09:01 -08:00
Peli de Halleux
1d56be507a 0.9.1 2017-02-08 15:43:49 -08:00
Peli de Halleux
6504007a65 bumped to v0.9 2017-02-08 15:43:41 -08:00
Peli de Halleux
fc0526e47c 0.8.6 2017-02-08 15:42:54 -08:00
Peli de Halleux
cb47a6a291 Bump pxt-core to 0.11.25 2017-02-08 15:42:52 -08:00
Peli de Halleux
6f8060a8c7 allow analog operations on digital pins (#353) 2017-02-08 15:42:39 -08:00
Peli de Halleux
4a8897c0a4 0.8.5 2017-02-07 22:52:08 -08:00
Peli de Halleux
839a26e5a7 Bump pxt-core to 0.11.24 2017-02-07 22:52:06 -08:00
Peli de Halleux
b46802804c 0.8.4 2017-02-07 14:19:03 -08:00
Peli de Halleux
34d1fac337 Bump pxt-core to 0.11.22 2017-02-07 14:19:01 -08:00
Peli de Halleux
39c41f26b1 0.8.3 2017-02-07 12:58:38 -08:00
Peli de Halleux
083a192a5b Bump pxt-core to 0.11.20 2017-02-07 12:58:36 -08:00
Peli de Halleux
76cbad0cec 0.8.2 2017-02-06 22:30:45 -08:00
Peli de Halleux
ed84d49667 Bump pxt-core to 0.11.16 2017-02-06 22:30:43 -08:00
Guillaume Jenkins
b9d867cf4e Enabled text blocks (#352) 2017-02-06 13:36:24 -08:00
Peli de Halleux
226dfa281a 0.8.1 2017-02-03 20:39:55 -08:00
Peli de Halleux
cc4f6c66da Bump pxt-core to 0.11.13 2017-02-03 20:39:54 -08:00
Peli de Halleux
49ecac6332 Showimage (#351)
* support for interval in showImage, showFrame

* added default arg to showFrame
2017-02-03 20:39:18 -08:00
Peli de Halleux
638e1d3c53 0.7.55 2017-02-03 15:44:29 -08:00
Peli de Halleux
712bc0ada4 Bump pxt-core to 0.11.12 2017-02-03 15:44:26 -08:00
Peli de Halleux
8437f0cf3c enable sharing 2017-02-03 15:23:46 -08:00
Peli de Halleux
9641c4b5ec fixed pin-pressed 2017-02-02 23:26:55 -08:00
Peli de Halleux
e29216c709 0.7.54 2017-02-02 23:22:56 -08:00
Peli de Halleux
06e255eeb9 Bump pxt-core to 0.11.11 2017-02-02 23:22:54 -08:00
Peli de Halleux
91c70e9809 0.7.53 2017-02-02 23:18:38 -08:00
Peli de Halleux
8014712994 Bump pxt-core to 0.11.10 2017-02-02 23:18:36 -08:00
Peli de Halleux
a7d5804cea 0.7.52 2017-02-01 16:46:58 -08:00
Peli de Halleux
2e5984a65b Bump pxt-core to 0.11.9 2017-02-01 16:46:48 -08:00
Tom Ball
c13bef01a4 remove image and move enum 2017-02-01 14:08:23 -08:00
Sam El-Husseini
16c08e4c9b 0.7.51 2017-02-01 09:50:31 -08:00
Sam El-Husseini
444c37edcb Bump pxt-core to 0.11.8 2017-02-01 09:50:31 -08:00
Tom Ball
51781be90b Merge pull request #350 from Microsoft/icons
add icons/arrows/clock
2017-02-01 09:28:09 -08:00
Peli de Halleux
741eb4e4b4 fixed typo in settings 2017-02-01 07:58:20 -08:00
Tom Ball
db4711fd26 remove hour, add advanced section 2017-01-31 15:54:23 -08:00
Tom Ball
8275fefd08 change name 2017-01-31 14:56:56 -08:00
Tom Ball
2d3ca71ffb add meta data 2017-01-30 17:05:06 -08:00
Tom Ball
3ba9d2867b add attribution 2017-01-30 16:51:40 -08:00
Tom Ball
ff7b229a3a add one image to make it spiffy 2017-01-30 16:42:48 -08:00
Tom Ball
f944af8122 get rid of images 2017-01-30 15:33:33 -08:00
Tom Ball
35225468e4 add some images 2017-01-30 15:03:50 -08:00
32 changed files with 1149 additions and 46 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

@@ -6,6 +6,7 @@
* **[Getting Started](/getting-started)**
* [Projects](/projects)
* [Examples](/examples)
* [Lessons](/lessons)
### @boardname@ reference

35
docs/examples.md Normal file
View 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
View File

@@ -0,0 +1,20 @@
# Blinky
```blocks
basic.forever(() => {
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .`
);
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .`
);
})
```

View File

@@ -0,0 +1,7 @@
# Name Tag
```blocks
basic.forever(() => {
basic.showString("JAMES")
})
```

View File

@@ -0,0 +1,10 @@
# Plot Acceleration
```blocks
basic.forever(() => {
led.plotBarGraph(
input.acceleration(Dimension.X),
1023
)
})
```

View File

@@ -0,0 +1,10 @@
# Plot Analog Pin
```blocks
basic.forever(() => {
led.plotBarGraph(
pins.analogReadPin(AnalogPin.P0),
1023
)
})
```

View File

@@ -0,0 +1,10 @@
# Plot Light level
```blocks
basic.forever(() => {
led.plotBarGraph(
input.lightLevel(),
255
)
})
```

7
docs/examples/rando.md Normal file
View File

@@ -0,0 +1,7 @@
# Rando
```blocks
basic.forever(() => {
led.toggle(Math.random(5), Math.random(5))
})
```

View File

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

BIN
docs/static/blocks/iconnames/heart.PNG vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

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

View File

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

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

View File

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

View File

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

View File

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

View File

@@ -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": "シリアル通信"
}

View File

@@ -6,9 +6,44 @@
"String.fromCharCode": "Lag en tekst som består av tegnet med den angitte ASCII-koden.",
"basic": "Blokker for grunnleggende mikro:bit-funksjonalitet.",
"basic.clearScreen": "Slå av alle lysene på skjermen",
"basic.forever": "Gjentar denne koden hele tiden, i bakgrunnen. Lar annen kode kjøre etter hver gjentakelse.",
"basic.pause": "Gjør at programmet venter en angitt tid, i millisekunder",
"basic.pause|param|ms": "hvor lenge pausen skal vare, f.eks: 100, 200, 500, 1000, 2000",
"basic.plotLeds": "Tegner et bilde på skjermen.",
"basic.plotLeds|param|leds": "mønster av lysdioder som er på",
"basic.showAnimation": "Viser en sekvens av bilder som en animasjon.",
"basic.showAnimation|param|interval": "tid i millisekunder mellom hver gang skjermbildet tegnes",
"basic.showAnimation|param|leds": "mønster av lysdioder som er på",
"basic.showLeds": "Tegner et bilde på skjermen.",
"basic.showLeds|param|interval": "pause i millisekunder etter visning",
"basic.showLeds|param|leds": "mønsteret som skal vises med lysdiodene",
"basic.showNumber": "Vis et tall, rullende over skjermen. Hvis tallet får plass på skjermen (dvs. er ett enkelt siffer), ruller det ikke.",
"basic.showNumber|param|interval": "farten til det som ruller over skjermen; f.eks: 150, 100, 200, -100",
"basic.showString": "Vis en tekst rullende over skjermen. Hvis strengen har bare ett tegn ruller den ikke.",
"basic.showString|param|interval": "hvor fort teksten skal rulle, f.eks: 150, 100, 200, -100",
"basic.showString|param|text": "teksten som ruller over skjermen, f.eks: \"Hallo!\""
"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."
}

View File

@@ -1,9 +1,197 @@
{
"String.charAt|block": "tegn fra %this|på plass %pos",
"String.concat|block": "sett sammen %this|%other",
"String.isEmpty|block": "%this| er tom",
"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",
"serial|block": "føljetong"
"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"
}

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

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

@@ -280,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
}

521
libs/core/icons.ts Normal file
View 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
}
}

View File

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

View File

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

View File

@@ -17,6 +17,7 @@
"helpers.ts",
"images.cpp",
"basic.cpp",
"icons.ts",
"input.cpp",
"input.ts",
"control.ts",

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

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

View File

@@ -1,3 +1,17 @@
{
"radio.onDataPacketReceived|block": "når radio mottar"
"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"
}

View File

@@ -1,6 +1,6 @@
{
"name": "pxt-microbit",
"version": "0.7.50",
"version": "0.9.6",
"description": "micro:bit target for PXT",
"keywords": [
"JavaScript",
@@ -36,6 +36,6 @@
"semantic-ui-less": "^2.2.4"
},
"dependencies": {
"pxt-core": "0.11.7"
"pxt-core": "0.11.33"
}
}

View File

@@ -14,8 +14,8 @@
"cloud": {
"workspace": false,
"packages": true,
"sharing": false,
"publish": false,
"sharing": true,
"publishing": true,
"preferredPackages": [
"Microsoft/pxt-neopixel",
"Microsoft/pxt-filesystem"
@@ -72,6 +72,7 @@
"loopsBlocks": true,
"logicBlocks": true,
"variablesBlocks": true,
"textBlocks": true,
"onStartColor": "#0078D7",
"onStartNamespace": "basic",
"onStartWeight": 54
@@ -207,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",

View File

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