Introduction
Our robot isn't very useful if it can't tell us how its mission is going. Let's learn about outputs and use some LEDs so it can talk back to us!
-
-
All robots have some way of telling the user what they are doing
-
This is called feedback - it is very important as it is very hard to understand what your robot is doing without it!
-
Take a washing machine for example - they always have lights on the front to tell you what is going on.
-
What about a robot hoover - they have feedback to say when they've finished, or when they need recharging
-
-
-
Let's add some LEDs to our robot so we can get some feedback about the mission.
-
Add the LED module to your robot like the picture.
-
Plug the Red side into the space marked A
-
And the Green side into the space marked B
-
-
-
The green and red LEDs are both outputs
-
An output is the name for anything that can be controlled by the Crumble 'brains' of your robot
-
Outputs can be set to either ON or OFF - there is no in between! In electronics, we call on HIGH, and off LOW.
-
Copy the program in the picture and upload it to your robot. The red LED should light up!
-
-
-
We can use the SET block to set any of the connections (A,B,C or D) to HI or LO (on or off).
-
You can change the letter and whether it is HI or LO by clicking them, just like the other blocks
-
Try changing the program so the green LED turns on!
-
-
-
We can use lots of set blocks to turn things on (and off) whenever we like!
-
Make a program that:
-
Turns on the green LED
-
Waits 1 second
-
Turns off the green LED, and turns on the red LED
-
Waits 1 second
-
Turns off the red LED
-
-
-
Load up your program that crosses the planet, picks up the astronaut, turns and drives back.
-
Add some output set blocks to turn on the red LED before the astronaut is picked up, then the green one after they are picked up and when the robot is driving back
-
Now your robot is giving some real feedback, so you can see from your base when it has picked up the astronaut!
-