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 2 - Lesson 3: Variable Counting

Picture
Learning Intention

I can use a variable to make Picoh count​


Introduction
​

Explain that we are going to make Picoh count. For this we are going to be creating a program that uses a variable.

You might want to discuss the use of a variable to keep and alter a score in a computer game. 
​First, we will use Make a Variable from the Data palette to create a variable called ‘Count’. Make sure there is a tick in the box next to count, this will display the value of the variable at the top left of the code area. 
Picture
Picture
​To start with we need to set the value of the variable. We can start our program with a when green flag clicked instruction. First, we need a set Count to 0 instruction. This means we will start counting at zero. Next, we need to make a loop where we continually increase the value of ‘count’ by 1. We do this using a forever instruction and a change Count by instruction with the value set to 1. We now need to test our code by clicking the green flag. Once successful, we can

File, Save As - countinones

​ We can now use our first variable program as a skeleton to make other counting programs using a variable. 

Picture
Activity

1. Can you write some code to make Picoh count in twos?
2. Can you write some code to make Picoh count in fives?
3. Can you write some code to make Picoh count in tens?
4. Can you write some code to make Picoh count in a 3 digit number?
5. Can you write some code to make Picoh count in a 4 digit number?

Picture
Extension

 Can you change the number that Ohbot starts counting from? Can you make Ohbot count in ones starting from 20?

​If Ohbot wants to start counting from 20, which part of the code do you think we 
have to change? (set Count to). Remember to set the tick next to the ‘Count’
variable on the Data palette so you can watch the counting in the display. 

File, Save As - countfrom20 

​We can now use this knowledge to complete other counting tasks. 

​

Picture
Extension Activities

2. Can you make Ohbot count in twos starting from 30?
3. Can you make Ohbot count in fives starting from 25?
4. Can you make Ohbot count in tens starting from 100?
5. Can you make Ohbot count in 125s starting from 1000?

Plenary
​
​
Encourage children to share their programs with the class and discuss ones that don’t work, work partially or have used a different algorithm to reach the same outcome. Encourage children to talk through how they work block by block and work as a class to debug a program to improve it. 
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