Input Block-List
Input Block: Events and data from sensors.
List of Input Blocks:
Blocks |
Description |
![]() |
Start an event handler (part of the program that will run when something happens, like when a button is pressed). This handler works when button A or B is pressed, or A and B together. When you are using this function in a web browser, click the buttons on the screen instead of the ones on the micro:bit. |
![]() |
|
![]() |
Start an event handler(part of the program that will run when something happens, like when a button is pressed). This handler works when you touch pin 0, 1 or 2 together with GND, and release it within 1 second. When you are using this function in a web browser, click the pins on the screen instead of the ones on the micro:bit.
|
![]() |
Check whether a button is pressed right now. The micro:bit has two buttons: button A and button B.
|
![]() |
Get the acceleration value (milli g-force) in one of three dimensions, or the combined force in all directions (x, y, and z).
dimension: the direction you are checking for acceleration, or the total strength of force.
|
![]() |
Find whether the pin you say is pressed or not pressed.
A string that holds the pin name (P0, P1, or P2) |
![]() |
Find the light level (how bright or dark it is) where you are. The light level 0 means darkness and 255 means bright light. The micro:bit measures the light around it by using some of the LEDs on the LED screen.
A Number that means a light level from 0(dark) to 255 (bright). |
![]() |
Find which direction on a compass the micro:bit is facing.
|
![]() |
Find the temperature where you are. The temperature is measured in Celsius (metric). The micro:bit can find the temperature nearby by checking how hot its computer chips are.
|
![]() |
Tests if a gesture is currently detected.
|
![]() |
Run some code when the microphone hears a sound.
|
![]() |
Run some code in your program when the micro:bit logo is pressed, touched, or released.
|
![]() |
Check if the micro:bit logo is currently being pressed.
|
![]() |
Find out what the the level of sound heard by the microphone is.
|
![]() |
Find how much the micro:bit is tilted in different directions.
|
![]() |
Find the amount of magnetic force (the strength of a magnet) in one of the three directions.
|
![]() |
Find how long it has been since the program started in milli-seconds.
|
![]() |
Find how long it has been since the program started in micro-seconds.
|
![]() |
The calibration will ask you to draw a circle or fill the LED screen by tilting the micro:bit.
When you flash a new program to your micro:bit via USB, this memory is cleared so you will have to re-calibrate it.
|
![]() |
Start an event handler (part of the program that will run when something happens, like when a button is pressed). This handler works when you release pin 0, 1, or 2 together with GND. When you are using this function in a web browser, click and release the pins on the screen instead of the ones on the micro:bit.
|
![]() |
Set up the part of the micro:bit that measures acceleration (how much the microbat is speeding up or slowing down), in case you need to measure high or low acceleration.
|
![]() |
Tell how loud it should be for your board to detect a loud sound.
|