Introduction to Pocket Code

Learners will be introduced to using mobile device based-Pocket Code programming to create apps to control Phiro robot.

Objective

By the end of this lesson, learners will be able to

  • Connect Pocket Code app to Phiro hardware via Bluetooth
  • Become familiar with Pocket Code extension blocks for Phiro
  • Be introduced to creative coding with Phiro & Pocket Code by exploring example program
  • Imagine possibilities of their own Pocket Code-based creative coding of robots
Subjects

Robotics, Coding

Ages

9 & above

Duration

30 min

Robot & Accessories Needed

Phiro Pro robot

Tools

Get Pocket Code app via Google Play

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

Understanding Pocket Code 4 Phiro

Pocket Code is a Scratch-like programming environment for Mobile Devices that allows you to build your own apps.

You can now use Pocket Code to connect to the physical world by program and control Phiro robots.

Want to know what's cool? You can use your mobile device's gyroscope, accelerometer, camera and other sensors to create SERIOUSLY FUN projects with Phiro.

STEP 2

Get Pocket Code on your mobile device

Download the free Pocket Code app from Google Play on your mobile device (OR) Scan the below QR code to download the app on your smartphone.

Note: Pocket Code currently runs well only on Smartphones and tablets with a screen size up to 7".

STEP 3

Explore Pocket Code blocks

Open Pocket Code app in your mobile device and follow along the pictures.

Follow step in this direction

Explore Pocket Code blocks

Open Pocket Code app in your mobile device and follow along the pictures.

Follow step in this direction

Explore Pocket Code blocks

Open Pocket Code app in your mobile device and follow along the pictures.

Follow step in this direction

Exploring Pocket Code Phiro Blocks

Phiro Motor Blocks Left Motor & Right Motor Range : 0 to 255 (0 is no speed, 127 is 50% speed, 255 is max speed)

Phiro Music Notes Play Do, Re, Me, Fa, So, La, Ti for various durations

Phiro LED lights Control independently or together Left or Right LED glow different colors

Phiro Obstacle Detection Check condition if Phiro detects something

Phiro Sensor Variables Create new variable and assign it to any of 6 Phiro Sensor Values.

STEP 4

Example Program 1

Create an App to make Phiro move forward for one second with Green LED "on" and Stop with Red LED light "on"

Once you have created your App to control Phiro, you are ready to connect your Pocket Code app to Phiro via Bluetooth.

STEP 5

Connect my Phiro to Pocket Code

1. Turn on Phiro

2. Press Phiro's Mode till Bluetooth is enabled (Blue LED will glow in Phiro Display Panel)

3. Open the Pocket Code app you created on your mobile device.

4. Press "Play" in Pocket Code program

5. Now select & pair Phiro with your mobile device

Bluetooth Passcode: 1234

(You will know it is paired when both Green LED glows next to Blue LED on Phiro Display Panel).

6. Now watch Phiro act out your code!