Hello World

One of the first programs that I like to write when starting to work on a new platform is a program that will simply prints out the text ‘Hello World’. This allows me to figure out exactly how to build and run programs. With that in mind, let’s get started!

As a starting point we will load the example ‘SimpleRobotBlank’ example. To load example code in the Arduino IDE, simply click on the ‘File’ menu, open the ‘Examples’ menu, and then choose the ‘SimpleRobotBlank’ option from the ‘SimpleRobot’ sub-menu.


Once loaded, you should see the following:

The first thing you will notice is that this program differs a bit from a normal Arduino sketch. First of all the Setup and Loop functions are moved into a C++ class (named MyRobot in this example), and that class is based on the Robot class which is defined in the include file SimpleRobot.h.

The Robot class performs a number of valuable functions that we will need to use during the course of our programming.  We won’t discuss the details of how the Robot class works here, but if you are interested, there will be another tutorial which will walk you through its creation.

The important thing you need to know is that the underlying Robot class will not let your program run until you tell it.  Ordinarily, an Arduino program will start executing the moment the download is complete.  This is an undesirable feature in our case since we would like to be able to set the robot up before we let it start.  To start the robot, we will start up a Driver Station program which will allow us to start and stop the robot remotely.

All we want to do with this program is to print out ‘Hello World’ when the program starts.  The perfect place to do this is in the Setup function which will be called once when you command the program to run from the Driver Station.  Do do this we will use the Arduino Serial.println function.  Add the following line to the setup function:

Once done, your final program should look like:

Now upload your program to the robot. The first thing you will notice is that nothing happens. Remember, your program will not start until you tell it to via the Driver Station.  In the next section, we will show you how to use the Driver Station to control your robot.

Next: Running Your Program

Pierre Pierre, who replica handbag 185cm tall, gucci replica handbags the "Diamond King" in his hermes replica handbags . He has been selected as one of the handbag replica most beautiful 50 people in the "People" magazine. It is also known as replica handbags most elegant and quiet in the world. Unforgettable prince.