Lösung morse1

Aus microbit - Das Schulbuch
Wechseln zu: Navigation, Suche

Hilfestellung

Detailschritte

  • Anzeige eines einzelen Morsesymbols

<prev id="01"> input.onButtonPressed(Button.A, function () {

   basic.showLeds(`
       . . . . .
       . . . . .
       . . . . .
       . . . . .
       . . . . .
       `)
   basic.showLeds(`
       . . . . .
       . . . . .
       . . # . .
       . . . . .
       . . . . .
       `)

}) input.onButtonPressed(Button.B, function () {

   basic.showLeds(`
       . . . . .
       . . . . .
       . . . . .
       . . . . .
       . . . . .
       `)
   basic.showString("-")

}) basic.showLeds(`

   . . # . .
   # # # # #
   . . # . .
   . # . # .
   # . . . #
   `)

</prev>

  • wenn-dann-Verzweigung

Geschuettel 01.png

  • Anzeige bei "wahr" - steht für Kopf
  • Anzeige bei "falsch" - steht für Zahl
  • Anzahl muss mitgezählt werden

Geschuettelt lsg.png

  • Anzahl wird jeweils ausgegeben

Anzeige taste.png

  • Nicht vergessen - Variablen auf 0 stellen

Beim start.png




Zurück zur Aufgabe