Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
82764ffcc1 | |||
f1404cef61 | |||
566b750419 | |||
b119952e75 | |||
e4e6a5effd | |||
ec1117842d | |||
de4242bf71 | |||
59322fb06b | |||
19e609c245 | |||
a5cb663316 | |||
1dd0c1793e | |||
a4a74bdd6b | |||
45c82767d0 | |||
0c77927f35 | |||
672672e632 | |||
fe2ae855b0 | |||
6612080885 | |||
8641a81e05 | |||
656e183a1a | |||
1d56be507a | |||
6504007a65 | |||
fc0526e47c | |||
cb47a6a291 | |||
6f8060a8c7 | |||
4a8897c0a4 | |||
839a26e5a7 | |||
b46802804c | |||
34d1fac337 | |||
39c41f26b1 | |||
083a192a5b | |||
76cbad0cec | |||
ed84d49667 | |||
b9d867cf4e | |||
226dfa281a | |||
cc4f6c66da | |||
49ecac6332 |
@ -6,6 +6,7 @@
|
||||
|
||||
* **[Getting Started](/getting-started)**
|
||||
* [Projects](/projects)
|
||||
* [Examples](/examples)
|
||||
* [Lessons](/lessons)
|
||||
|
||||
### @boardname@ reference
|
||||
|
35
docs/examples.md
Normal file
35
docs/examples.md
Normal file
@ -0,0 +1,35 @@
|
||||
# Examples
|
||||
|
||||
Here are some fun programs for your @boardname@!
|
||||
|
||||
## Fun stuff
|
||||
|
||||
```codecard
|
||||
[{
|
||||
"name": "Blinky",
|
||||
"url":"/examples/blinky"
|
||||
},
|
||||
{
|
||||
"name": "Name Tag",
|
||||
"url":"/examples/name-tag"
|
||||
},
|
||||
{
|
||||
"name": "Rando",
|
||||
"url":"/examples/rando"
|
||||
}]
|
||||
```
|
||||
|
||||
## Sensors
|
||||
|
||||
```codecard
|
||||
[{
|
||||
"name": "Plot Acceleration",
|
||||
"url":"/examples/plot-acceleration"
|
||||
}, {
|
||||
"name": "Plot Light Level",
|
||||
"url":"/examples/plot-light-level"
|
||||
}, {
|
||||
"name": "Plot Analog Pin",
|
||||
"url":"/examples/plot-analog-pin"
|
||||
}]
|
||||
```
|
20
docs/examples/blinky.md
Normal file
20
docs/examples/blinky.md
Normal file
@ -0,0 +1,20 @@
|
||||
# Blinky
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
);
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .`
|
||||
);
|
||||
})
|
||||
```
|
7
docs/examples/name-tag.md
Normal file
7
docs/examples/name-tag.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Name Tag
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showString("JAMES")
|
||||
})
|
||||
```
|
10
docs/examples/plot-acceleration.md
Normal file
10
docs/examples/plot-acceleration.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Plot Acceleration
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
led.plotBarGraph(
|
||||
input.acceleration(Dimension.X),
|
||||
1023
|
||||
)
|
||||
})
|
||||
```
|
10
docs/examples/plot-analog-pin.md
Normal file
10
docs/examples/plot-analog-pin.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Plot Analog Pin
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
led.plotBarGraph(
|
||||
pins.analogReadPin(AnalogPin.P0),
|
||||
1023
|
||||
)
|
||||
})
|
||||
```
|
10
docs/examples/plot-light-level.md
Normal file
10
docs/examples/plot-light-level.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Plot Light level
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
led.plotBarGraph(
|
||||
input.lightLevel(),
|
||||
255
|
||||
)
|
||||
})
|
||||
```
|
7
docs/examples/rando.md
Normal file
7
docs/examples/rando.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Rando
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
led.toggle(Math.random(5), Math.random(5))
|
||||
})
|
||||
```
|
21
libs/bluetooth/_locales/no/bluetooth-strings.json
Normal file
21
libs/bluetooth/_locales/no/bluetooth-strings.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"bluetooth.advertiseUid|block": "bluetooth kringkast UID|namespace (bytes 6-9)%ns|instance (bytes 2-6)%instance|med sendereffekt %power|kan tilkobles %connectable",
|
||||
"bluetooth.advertiseUrl|block": "bluetooth kringkast url %url|med sendereffekt %power|kan tilkobles %connectable",
|
||||
"bluetooth.onBluetoothConnected|block": "når bluetooth tilkobles",
|
||||
"bluetooth.onBluetoothDisconnected|block": "når bluetooth frakobles",
|
||||
"bluetooth.setTransmitPower|block": "bluetooth sett sendereffekt %power",
|
||||
"bluetooth.startAccelerometerService|block": "bluetooth akselerometer-tjeneste",
|
||||
"bluetooth.startButtonService|block": "bluetooth trykknapp-tjeneste",
|
||||
"bluetooth.startIOPinService|block": "bluetooth digital tilkobling-tjeneste",
|
||||
"bluetooth.startLEDService|block": "bluetooth LED-tjeneste",
|
||||
"bluetooth.startMagnetometerService|block": "bluetooth magnetometer-tjeneste",
|
||||
"bluetooth.startTemperatureService|block": "bluetooth temperatur-tjeneste",
|
||||
"bluetooth.startUartService|block": "bluetooth serieport-tjeneste (UART)",
|
||||
"bluetooth.stopAdvertising|block": "bluetooth stopp kringkasting",
|
||||
"bluetooth.uartReadUntil|block": "bluetooth serieport|les frem til %del=serial_delimiter_conv",
|
||||
"bluetooth.uartWriteNumber|block": "bluetooth serieport|skriv tall %value",
|
||||
"bluetooth.uartWriteString|block": "bluetooth serieport|skriv tekst %data",
|
||||
"bluetooth.uartWriteValue|block": "bluetooth serieport|skriv verdi %name|= %value",
|
||||
"bluetooth|block": "bluetooth",
|
||||
"{id:category}Bluetooth": "Bluetooth"
|
||||
}
|
@ -7,7 +7,8 @@
|
||||
"shims.d.ts",
|
||||
"bluetooth.ts",
|
||||
"bluetooth.cpp",
|
||||
"_locales/de/bluetooth-jsdoc-strings.json"
|
||||
"_locales/de/bluetooth-jsdoc-strings.json",
|
||||
"_locales/no/bluetooth-strings.json"
|
||||
],
|
||||
"public": true,
|
||||
"dependencies": {
|
||||
|
@ -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",
|
||||
@ -127,9 +140,7 @@
|
||||
"Rotation.Roll|block": "roll",
|
||||
"String.charAt|block": "char from %this=text|at %pos",
|
||||
"String.compare|block": "compare %this=text| to %that",
|
||||
"String.concat|block": "join %this=text|%other",
|
||||
"String.fromCharCode|block": "text from char code %code",
|
||||
"String.isEmpty|block": "%this=text| is empty",
|
||||
"String.length|block": "length of %VALUE",
|
||||
"String.substr|block": "substring of %this=text|from %start|of length %length",
|
||||
"String|block": "String",
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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": "シリアル通信"
|
||||
}
|
@ -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."
|
||||
}
|
@ -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"
|
||||
}
|
26
libs/core/enums.d.ts
vendored
26
libs/core/enums.d.ts
vendored
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
@ -105,7 +105,7 @@ enum IconNames {
|
||||
//% block="square"
|
||||
Square,
|
||||
//% block="small square"
|
||||
SmallSquare
|
||||
SmallSquare,
|
||||
}
|
||||
|
||||
enum ArrowNames {
|
||||
@ -155,355 +155,325 @@ namespace basic {
|
||||
|
||||
namespace images {
|
||||
|
||||
const heart = `
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
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 {
|
||||
|
||||
const small_heart = `
|
||||
. . . . .
|
||||
. # . # .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .`
|
||||
switch (i) {
|
||||
case IconNames.Heart : return `
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`;
|
||||
|
||||
//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 = `
|
||||
. . # . .
|
||||
. # # # .
|
||||
# # . # #
|
||||
. # # # .
|
||||
. . # . .`
|
||||
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"
|
||||
@ -522,17 +492,7 @@ namespace images {
|
||||
. . . . .
|
||||
. . . . .
|
||||
`)
|
||||
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;
|
||||
return set(res, getArrow(i));
|
||||
}
|
||||
|
||||
//% weight=50 blockGap=8
|
||||
@ -545,54 +505,7 @@ namespace images {
|
||||
. . . . .
|
||||
. . . . .
|
||||
`)
|
||||
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;
|
||||
return set(res, getIcon(i));
|
||||
}
|
||||
|
||||
function set(res: Image, s: string) {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
8
libs/core/shims.d.ts
vendored
8
libs/core/shims.d.ts
vendored
@ -40,8 +40,8 @@ declare interface Image {
|
||||
*/
|
||||
//% help=images/show-image weight=80 blockNamespace=images
|
||||
//% blockId=device_show_image_offset block="show image %sprite|at offset %offset" blockGap=8
|
||||
//% parts="ledmatrix" shim=ImageMethods::showImage
|
||||
showImage(xOffset: number): void;
|
||||
//% parts="ledmatrix" async interval.defl=400 shim=ImageMethods::showImage
|
||||
showImage(xOffset: number, interval?: number): void;
|
||||
|
||||
/**
|
||||
* Draws the ``index``-th frame of the image on the screen.
|
||||
@ -118,8 +118,8 @@ declare interface Image {
|
||||
* @param frame TODO
|
||||
*/
|
||||
//% weight=70 help=images/show-frame
|
||||
//% parts="ledmatrix" shim=ImageMethods::showFrame
|
||||
showFrame(frame: number): void;
|
||||
//% parts="ledmatrix" interval.defl=400 shim=ImageMethods::showFrame
|
||||
showFrame(frame: number, interval?: number): void;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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"
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pxt-microbit",
|
||||
"version": "0.7.55",
|
||||
"version": "0.9.7",
|
||||
"description": "micro:bit target for PXT",
|
||||
"keywords": [
|
||||
"JavaScript",
|
||||
@ -36,6 +36,6 @@
|
||||
"semantic-ui-less": "^2.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"pxt-core": "0.11.12"
|
||||
"pxt-core": "0.11.35"
|
||||
}
|
||||
}
|
||||
|
@ -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",
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user