Import
You always need to have the line at the start of your programIf you use random, music or radio in your program you need to remember to also import them at the top of your program as well General
sleep tells the Microbit to stop doing anything for as long as you tell it temperature gets the current temperature running_time gets the amount of time since the Microbit started running the program Buttons
Show a happy face if button A is being pressed or show a sad face is button B is being pressed. Random
randrange picks a random number in the range random.choice picks a random thing out of a list of things |
Display
Radio
When you have more than 1 Microbit, you can send and receive messages using the radio. If there are other Microbits using the radio around you, make sure that you are using a different channel number (using ) so that you aren't accidentally receiving their messagesGestures
Speech
|
Music
Setting wait=False tells the Microbit to play the music and keep going with the rest of the program, otherwise it will wait until the music is done Setting loop=True, will keep looping the music over and over instead of just playing once Music
Accelerometer
This code checks what the current gesture is that is happening to the Microbit and shows a sad face if it is a shake |
Cheatography
https://cheatography.com
Micro:Bit Cheat Sheet by aleciko
Cheat sheet for the BBC Micro:Bit
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets