In this second tutorial, you'll program a "Hello World" app for your robot by using its LED light, speaker, and push button.
The goals of this tutorial are to help you:
Understand how to use the Arduino programming language to code apps for your robot
Program a Hello World app that controls your robot's LED light, speaker, and push button
The RedBot robot runs apps written in a programming language called Arduino. The Arduino language is designed to make it easier to write programs for microcontrollers. Many electronic kits and robotics kits use Arduino for programming.
An Arduino program (or app) is also referred to as a sketch because the Arduino language is designed to allow you to quickly create a program — just like a sketch is a quick drawing.
These tutorials will introduce you to some of the basics of programming with Arduino. For additional help, the Arduino Programming Language Reference is useful for learning more about the structure and syntax of Arduino code.
When learning a new programming language, the first step that many people take is to create what is called a "Hello World" program. Traditionally, this program simply displays the text "Hello World" on the screen and only requires a few lines of code. The purpose is to demonstrate that you can create a simple yet functional program in the new coding language. It's a first step before creating more complex programs.
However, your robot does not have a built-in screen. The good news is your RedBot circuit board does have a built-in green LED light (D13) that can be controlled by your robot's app. So you'll first program a simple app that makes the built-in LED blink on and off repeatedly, as a way of saying "Hello World."
After that you'll modify the app to use the robot's speaker to produce a "beep" sound when the LED light blinks. Then you'll modify the app to detect when the built-in button (D12) on the circuit board is pressed, in order to make the LED blink and the speaker beep. Once all that is done, you'll start programming apps to make your robot drive around.