This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module main | |
author unknown | |
version 1 0 | |
description '' | |
variables x y px verloren punkte | |
spec ' ' 'berechne' 'berechne' | |
spec ' ' 'nerviger ton' 'nerviger ton' | |
spec ' ' 'runde' 'runde' | |
spec 'r' 'scaliere' 'scaliere _' 'auto' 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from calliope_mini import * | |
from random import randrange | |
faktor1 = 0 | |
faktor2 = 0 | |
while True: | |
if button_a.is_pressed(): | |
faktor1 = randrange(1, 10) | |
faktor2 = randrange(1, 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Send a message to one of three friends, or all of them at once | |
from gpiozero import Button, LED, PWMLED | |
from time import time, sleep | |
from gpiozero.pins.pigpio import PiGPIOFactory | |
factory = PiGPIOFactory(host='raspberrypi') | |
me = "Lena" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Detect motion | |
from gpiozero import Buzzer, MotionSensor | |
from time import sleep | |
buz = Buzzer(17) | |
pir = MotionSensor(4) | |
while True: | |
pir.wait_for_motion() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reaction game | |
from gpiozero import Button, LED | |
from time import time, sleep | |
from random import randint | |
from gpiozero.pins.pigpio import PiGPIOFactory | |
factory = PiGPIOFactory(host='raspberrypi') | |
led = LED(17, pin_factory=factory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Energy light | |
from gpiozero import LED, Button | |
from time import sleep, time | |
from gpiozero.pins.pigpio import PiGPIOFactory | |
factory = PiGPIOFactory(host='raspberrypi') | |
led = LED(17, pin_factory=factory) | |
btn = Button(4, pin_factory=factory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Chorus of Billy Jean | |
import wiringpi | |
import time | |
import pitches | |
melody = [ | |
0, | |
"NOTE_FS4", | |
"NOTE_FS4", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Traffic lights | |
from gpiozero import LED | |
from time import sleep | |
from gpiozero.pins.pigpio import PiGPIOFactory | |
factory = PiGPIOFactory(host='raspberrypi') | |
red_led = LED(17, pin_factory=factory) | |
yellow_led = LED(27, pin_factory=factory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Morse a text | |
# https://en.wikipedia.org/wiki/Morse_code | |
from gpiozero import LED | |
from time import sleep | |
led = LED(17) | |
# the higher this number, the slower the blinking | |
speed = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <tb_display.h> | |
#include <M5StickC.h> | |
#include <WiFi.h> | |
#include <Espalexa.h> | |
// prototypes | |
boolean connectWifi(); | |
//callback functions |