This website uses cookies to ensure you get the best experience on our website.
Ohbot
  • OH
    • Educators
    • Makers
  • About
    • Our Robots
    • Our Story
    • Follow Us
    • Contact
  • Shop
    • All Robots
    • Ohbot Assembled
    • Ohbot Kit
    • Picoh
    • OhbotApp2
    • Accessories
    • Resellers
  • Get Started
    • Ohbot Assembled
    • Ohbot Kit
    • Picoh
    • Accessories
    • Technical Notes
    • Languages
    • Support
  • Learn
    • Picoh
    • Ohbot
    • AI
    • Robot Work
    • Share

<-PICOH SCHEME

Sequence 1 - Lesson 2: Key Moves

Picture
Learning Intention
​
I can program a robot to carry out a sequence of movements when a key is pressed.

Introduction
​

​How do you control players when playing computer games? One way is using a computer keyboard with different keys triggering the computer game sprite to carry out different movements such as jumping. We are going to write programs to make Picoh carry out different sequences of movements when different keys are pressed. 
Picture
Teacher Input 1

Let’s make Ohbot nod once whenever the N key is pressed. First we will start with an event instruction. In the last lesson we used the When green flag clicked event block to start our sequence. This time we are going to use When___ Key Pressed. Use the drop-down menu to select N as the trigger key.

The scripts will be similar to those created in the previous lesson. Use 10 and 0 for maximum movements in either direction and 5 to bring Picoh back to the middle point. Work through the N for nod instructions with the children. Ask the children to write the code for S for shake by themselves using the N for nod code as a skeleton.

File, Save As - keyboardNandS

Picture
Activity

Can you write some code to use the keyboard to control my pupils?
  • U to look up, down then centre
  • ​L to look left, right then centre
Extension

Can you write some code to use the keyboard to control my lips?
  • Up arrow key to smile for one second
  • Down arrow key to frown for one second 
Plenary

When we use the keyboard to control Picoh, Picoh’s head will run a sequence only if a key is being pressed. Although this is often a good way for a system to work (such as for the doors on a train that might require a human to check that it is safe for the train to leave), sometimes we may want the robot to carry out actions over and over again without needing a human to start it each time. Have a look at the code blocks to see if you can find a way of performing movements again and again without needing a human to press the key?

We need to use the repeat instruction from the Control palette. Next week we learn to write code using repeat.
Picture
OH
Educators
Makers

About
Our Story
Follow Us
Consultancy
Contact
Shop
All Robots
Ohbot Assembled
Ohbot Kit
Picoh
OhbotApp2
Accessories
Resellers
Get Started
​Ohbot Kit
Ohbot Assembled
Picoh
Accessories
Technical Notes

Languages
Support

Learn
Picoh

Ohbot
AI
Robot Work
Share
Picture
Picture
Picture
Picture
Picture
​Ohbot Ltd. 2A Halliday's Mill, London Road, Chalford, Gloucestershire, GL6 8NR, UK
Copyright © Ohbot Ltd.  All rights reserved.
​Ohbot
® is a registered trademark of Ohbot Ltd.
  • OH
    • Educators
    • Makers
  • About
    • Our Robots
    • Our Story
    • Follow Us
    • Contact
  • Shop
    • All Robots
    • Ohbot Assembled
    • Ohbot Kit
    • Picoh
    • OhbotApp2
    • Accessories
    • Resellers
  • Get Started
    • Ohbot Assembled
    • Ohbot Kit
    • Picoh
    • Accessories
    • Technical Notes
    • Languages
    • Support
  • Learn
    • Picoh
    • Ohbot
    • AI
    • Robot Work
    • Share