Gyro Control Phiro

Learners will create a gyro sensor-remote control App for Phiro in the Pocket Code environment.

Objective

By the end of this lesson, learners will

  • Understand their mobile device's gyrosensor
  • Understand and use the computational concept of Variables and Control to create a program
  • Learn to program Phiro in response to mobile device's gryosensor
  • Connect the physical and digital worlds
  • Develop greater fluency of sequence and debugging
  • Practice experimenting & iterating
  • Express their creativity by programming a gyro-controlled robot system.
Subjects

Robotics, Coding, Sensors, Gyro Control

Age

9 & above

Duration

40 min

Robot & Accessories Needed

Phiro Pro robot

  • step1
  • step2
  • step3
  • step4
  • step5
  • step6
STEP 1

Ask

  • Think about how your smartphone or tablet can sense the way you tilt the device.
  • Experiment with your mobile device to see how objects on the screen move based on tilt movement and orientation. This is the job of a gyroscope sensor!
  • How would you use your mobile device's gyro sensor to control things in the physical world?
STEP 2

Imagine

The gyro sensor on a mobile device allows you to tilt your device to more smoothly and quickly control the robot.

Imagine how you would control Phiro using a gyro sensor remote control. What would you need in Phiro and Pocket Code?

1. Get Condition for device tilt direction

2. Move Phiro in direction

STEP 3

Plan

Plan your tilt remote control

Get Condition for device tilt direction

Explore the values of inclination_x & inclination_y under sensor blocks. Take a note of change in values of inclination_x & inclination_y, when Smartphone is tilted.

Try below script to tilt your Smartphone in all direction to check Inclination_x & Inclination_y values and sketch algorithm and phiro movement with respective to those values.

STEP 4

Create

Create your tilt remote control

1. Get Condition for device tilt direction

2. Move Phiro in direction

3. Connect Phiro via bluetooth mode to your device.

Title Remote Control - Sample Script

STEP 5

Remix

Remix the program for your device screen to change respective direction according to mobile tilt.

Remix the same program and control Phiro's speed using '+' and '-' objects.

STEP 6

Share

Share your tilt - remote control for Phiro using #MyPhiro and we will share it with the world!