In addition to starting your program with On Start or the Forever block, you can use the On Shake block found in the Input Category. The “shake” gesture uses several accelerometer sensor readings to decide if the micro:bit has been shaken or moved in a particular direction.
Examples of IF/THEN statements
If the fire alarm rings, then _____.
If the referee blows the whistle, then _____.
If the alarm clock goes off in the morning, then _____.
If the traffic light is red, then _____.
If your cell phone battery charge is at 0%, then _____.
A variable is like a special container that can hold different kinds of information like numbers or words. Its main job is to keep track of information that might be needed later on in a program.
You will need to create a variable to make the code work.
Let's write your very first program, Skip Counting, using a variable! The following cards, Number Fun and Dice use variables also.