Lesson 4 Accelerometer.

Slides:



Advertisements
Similar presentations
NXT Basics: Technic Building and NXT-G Erin Cejka Riecker Center for Engineering Educational Outreach Tufts University.
Advertisements

By Droids Robotics INTERMEDIATE PROGRAMMING LESSON BRICK BUTTONS AS SENSORS.
Lesson 1 Sequencing.
BBC MICRO:BIT Lesson 6 Networking. Digital devices can be networked together to exchange data. You are going to create a very simple network using two.
BBC MICRO:BIT Lesson 2 Variables and Lists. Variables When programming it is often necessary to store a value for use later on in the program. A variable.
Lesson 4 Accelerometer.
Lesson 5 Music.
GCSE COMPUTER SCIENCE Practical Programming using Python
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
Starter What is BBC micro:bit?
MOM! Phineas and Ferb are … Aims:
Broadcasting (Adding a new level)
Bbc microbit Lesson 3 – Temperature hot medium.
Add and Subtract Negative Numbers
Selection Learning Objective: to be able to design algorithms that use selection.
Servo Positioning Pulse Width Direction of Rotation PULSOUT Period
micro:bit for primary schools – mb4ps.co.uk
Starter Activity Instructions: Complete the starter sheet Planner
Wireless hand game controller
Learning Objective: to be able to design programs that use sequencing.
micro:bit for primary schools – mb4ps.co.uk
BBC Microbit.
BBC Microbit.
BBC Microbit.
micro:bit for primary schools – mb4ps.co.uk
BBC Microbit.
Stopwatch Cards Stopwatch Cards
Music Cards Music Cards
Music Cards Music Cards
Dance Cards Dance Cards
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
Learning to Code with the MicroBit
BBC Microbit.
Music Cards Music Cards
Dance Cards Dance Cards
Game Controller Lesson Three.
Dance Cards Dance Cards
Dance Cards Dance Cards
Selection Learning Objective: to be able to design algorithms that use selection.
Dance Cards Dance Cards
Dance Cards Dance Cards
BBC Microbit.
BBC Microbit.
HOW TO CREATE A CLASS Steps:
BBC Microbit.
Music Cards Music Cards
Game Controller Lesson Two.
Dance Cards Dance Cards
Stopwatch Cards Stopwatch Cards
Music Cards Music Cards
Getting Started with Physical Computing
INTERMEDIATE PROGRAMMING LESSON
Dance Cards Dance Cards
Lesson 2.
BBC Microbit.
Stopwatch Cards Stopwatch Cards
micro:bit for primary schools – mb4ps.co.uk
Music Cards Music Cards
Dance Cards Dance Cards
BBC Microbit.
Stopwatch Cards Stopwatch Cards
Just Basic Lessons 9 Mr. Kalmes.
Dance Cards Dance Cards
Dance Cards Dance Cards
Stopwatch Cards Stopwatch Cards
Lesson 1 – using the LED lights
Dance Cards Dance Cards
Learning Objective: to be able to design programs that use iteration.
Stopwatch Cards Stopwatch Cards
Dance Cards Dance Cards
Presentation transcript:

Lesson 4 Accelerometer

Gestures The in built accelerometer can be used to detect movement and direction. This allows the micro:bit to recognise the following gestures. This example program displays a happy face if the micro:bit is facing up, otherwise it displays a sad face. Try it for yourself. up down left right face up face down shake

Place a screenshot of your code here. Activity 4.1 Create a program that will show different images when different gestures are detected. Use this code as a starting point: Place a screenshot of your code here.

Activity 4.2 You are going to create a rock, paper, scissors game using your micro:bit. The first thing you need to do is design the images. Rock Paper Scissors Shade in Values 0-9

Place a screenshot of your code here. Activity 4.3 This is the incomplete code for the rock, paper, scissors game. You need to replace the comments with appropriate lines of code. Place a screenshot of your code here.

Accelerometer The accelerometer can be used to detect precise movement along three axes: X – tilting from left to right Y – tilting forwards and backwards Z – moving up and down When the reading is 0 you are “level” along that axis. This program acts like a basic spirit level. Displaying – if the micro:bit is level, < if it is tilted to the left and > if it is titled to the right. Try it out for yourself.

Running Time The micro:bit keeps track of the amount of time it has been running. This example program has a while loop that will keep running until button a is pressed. The running time is then calculated in seconds and displayed on the screen. The break command is used to break out of a loop. Try it out for yourself.

Place a screenshot of your code here. Activity 4.4 This is the incomplete code for a game. The aim is to hold the micro:bit level for as long as possible. It’s incomplete, you need to replace the comments with appropriate lines of code. Place a screenshot of your code here.

Extension Change the sensitivity of the game to make it harder. Place a screenshot of your code here.