From db3451b22c0c17f97fce71c4e2efea3787aec069 Mon Sep 17 00:00:00 2001
From: Anne Zeller
+ Über das
- und
- Zeichen kann man die Bedingung anpassen:
- Hilfe:
- http://eis.ph-noe.ac.at/microbit02/
- Helligkeit auf einen beliebigen Wert setzen:
-
-
+
+
Projekt: Emotion Badge
Userstory
-
-
Funk: Entschlüsseln
Ich möchte mit einem Emoji Gefühle darstellen und den Anfangsbuchstaben meines Namens anzeigen.
+
+
+
+
+
+
+ Eingaben verarbeiten und Emoji ausgeben
-
- let emoji = 0
- if (emoji == 1) {
- basic.showIcon(IconNames.Heart)
- } else if (emoji == 2) {
- basic.showLeds(`
- # # . # #
- # # . # #
- . . # . .
- # . . . #
- . # # # .
- `)
- } else if (emoji == 3) {
- basic.showIcon(IconNames.Giraffe)
- }
-
+
-
Eingabe: Drücke Taste ...
-
-
Eine Zählvariable verwenden
-
- let emoji = 0
- if (emoji == 0) {
- emoji += 1
- }
-
-
-
+ input.onButtonPressed(Button.A, function () {
+
+ basic.showIcon(IconNames.Happy)
+
+ )}
+
+ input.onButtonPressed(Button.B, function () {
+
+ basic.showIcon(IconNames.Sad)
+
+ )}
+
+ input.onButtonPressed(Button.AB, function () {
+ basic.showLeds(`
+
+ . # # # .
+
+ . # . . .
+
+ . # # # .
+
+ . . . # .
+
+ . # # # .
+
+ `)
+
+ )}
+
+
+
+
+
-
-
Nachricht senden
- Helligkeit der LED's anpassen
Eingabe: Drücke Taste B
+
- input.onButtonPressed(Button.B, function () {
- basic.showLeds(`
- # # # # #
- # # # # #
- # . # . #
- # . . . #
- # # # # #
- `)
- basic.showIcon(IconNames.Yes)
- })
-
+
-
+ basic.showLeds(`
+
+ . # # # .
+
+ . # . . .
+
+ . # # # .
+
+ . . . # .
+
+ . # # # .
+
+ `)
+
+ led.setBrightness(50)
+
+
+
+
+
+
+
+
+ input.onGesture(Gesture.Shake, function() {
+
+ basic.showIcon(IconNames.Scissors)
+
+ }
+
+
+
+
+ input.onGesture(Gesture.Shake, function() {
+
+ let tool = Math.randomRange(0, 2)
+
+ if (tool == 0) {
+
+ basic.showIcon(IconNames.Square_small)
+
+ } else if (emoji == 1) {
+
+ basic.showIcon(IconNames.Square)
+
+ } else if (emoji == 2) {
+
+ basic.showIcon(IconNames.Scissors)
+
+ }
+
+ }
+
+
+
+
+ Hilfe: - Activity: Installing a - program +
Hilfe: + Activity: Installing a + + program + +
+ + + + +
+ Ich möchte, wenn ich die Taste A des Microbits drücke, einen Countdown und einen Ton abspielen.
+
+
+
+