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 gpiozero import Button | |
button1 = Button(2) | |
button2 = Button(3) | |
def check_button(): | |
button_press = False | |
while button_press == False: | |
b1 = button1.value | |
b2 = button2.value |
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 gpiozero import Button | |
from gpiozero import LED | |
import time | |
import random | |
button1 = Button(2) | |
button2 = Button(3) | |
led1 = LED(20) | |
led2 = LED(21) |
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 microbit import * | |
import random | |
messages =["message 1", | |
"message 2", | |
"Message 3" | |
] #You can have as many messages as you would like | |
while True: | |
display.show("8") | |
if accelerometer.was_gesture("shake"): |
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 microbit import * | |
import random | |
messages =["Message 1 goes here", | |
"Message 2 goes here", | |
"Message 3 goes here" | |
] #You can have as many messages as you would like | |
my_message=random.choice(messages) | |
display.scroll(my_message) | |
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
import time | |
import mcpi.minecraft as minecraft | |
import mcpi.block as block | |
import random | |
import math | |
from gpiozero import Button | |
mc=minecraft.Minecraft.create() | |
button = Button(21) |
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 gpiozero import Button | |
from gpiozero import LED | |
from time import * | |
import time | |
import random | |
button = Button(21) | |
green =LED(2) | |
yellow=LED(3) |
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 gpiozero import Button | |
from gpiozero import LED | |
from time import * | |
import time | |
import random | |
button = Button(21) | |
green =LED(2) | |
yellow=LED(3) |