3.02: Accelerometer
Lesson Overview
Another sensor that Marty has is the accelerometer which can track his movement. In this lesson, students will anaylse Marty’s accelerometer readings and use this to create a small game in MartyBlocks where when we move Marty around, this moves the sprite around on the screen
Key vocabulary:
- Accelerometer, Movement, Programming, Input, Values, Game,
Content Sections
3.02: Accelerometer
Lesson Overview
Another sensor that Marty has is the accelerometer which can track his movement. In this lesson, students will anaylse Marty’s accelerometer readings and use this to create a small game in MartyBlocks where when we move Marty around, this moves the sprite around on the screen
Key vocabulary:
- Accelerometer, Movement, Programming, Input, Values, Game,
- A firm grasp of coordinates; a strong awareness of conditional statements; awareness of accelerometers
- Tablet with Bluetooth 4.2+
-
- Marty the Robot
- Marty Workbook pages
- Tablet with Bluetooth 4.2+
- Access to the MartyBlocks editor
Learning Objectives
- Understand what an accelerometer is and what other devices may contain accelerometers
- Monitor the values that are stored by the accelerometer in Marty
- Create a small game where moving Marty around will move the sprite around on the screen
- Research into what an accelerometer is and what other devices contain them. What is an accelerometer? What is it used for? Complete the task in workbooks looking at which devices have accelerometers in them
- Split students into small groups that will be experimenting with the values that the accelerometer calculates by storing the values into variables so that we can monitor them (note that students may want to multiply the value by 1000 to get an easily readable number). How do these values change when Marty walks? How do these values change when you physically move Marty from side to side or forwards and backward? Which one changes when you move Marty left to right? (X, Y or Z)
- Create a small game where Marty is the input to move the sprite around the screen. Based on the notes that students took whilst monitoring the sensor values, they can work out what the thresholds are for the sprite to start to move left or right
Extensions & Support
- Extend the game by turning it into a multiplayer game where two people can play using two Martys as input
- Can students use X, Y and Z values to move sprites around on the screen?
Additional Reading
- Educator’s Guide
- Introduction to Programming with MartyBlocks
- Middle School Technology Applications: Grade 6 to Grade 8
- Technologies: Computing Science
- Literacy & English: Listening and Talking
- Health and Wellbeing: Mental, Emotional, Social and Physical Wellbeing
- Literacy & English: Writing
- Computing, Design and Technology: Design and Technology
- Computing, Design and Technology: Computing
- CSTA Education Standards
- Digital Technologies, Design & technologies: Design & Technologies
- Digital Technologies, Design & technologies: Digital Technologies
- International Society for Technology in Education (ISTE)