Variable Types

A variable is a special, small place in memory that stores information. To refer to this memory location and use it, we refer to its location by a name we make up, the variable name. There are two types of numbers we will put in a memory location: long: an integer that spans a larger […]

Read More

Hello World for Arduinos

It is tradition that whenever you learn a new language or turn on a new computer, the first command you send is “hello world”.  It started with Brian Kernighan in 1978 when he introduced the C language. In Arduino speak, instead of printing the words “hello world” to announce to the world our Arduino is […]

Read More

Using the Delay() Function and Auto Format

One of the ways of adjusting the timing flow in a sketch is with the Delay() function. Usually, if a command has a () after it, it is a function. The delay() function is built into the Arduino IDE. You can look up the details for the delay() function in the reference page. When the […]

Read More

The void loop() Function

Every Arduino Sketch has a void loop() section. The presence of the () at the end indicates this command is a function, a special routine that is executed when the code comes down to it. This function will cause all the code between the { curly } brackets is executed, starting at the top line. […]

Read More

Where to Find The Commands

In this series of experiments on the www.HackingPhysics.com web site, we’ll be introducing many of the common and useful commands. However, its always useful to know where to get more information. Before you google “Arduino common commands” you should check the reference page that is built into the IDE.  Under Help select the Reference item […]

Read More

Controlling Digital I/O

As the very first operation, we will turn on the LED that is already mounted to the Arduino Board next to pin 13, as shown in the figure below. Each digital pin on the right side of the board is labeled 0 to 13. The pin labeled 13 is significant since it is the only […]

Read More

Upload a Sketch for the First Time

The right pointing arrow at the top of the sketch is the upload button as shown below. Click this arrow and the sketch will be uploaded to the Arduino, if everything is working. Try it. You will see some words go by at the bottom of the sketch and hopefully some lights flash on the […]

Read More

Connect Your Arduino to the USB Cable

All the drivers for the USB port to recognize the Arduino are installed when the IDE is set up. When the USB cable is plugged into the Arduino, you might hear the “happy sound” of a device being recognized by the USB port. In addition to the physical connection with the USB cable, we need […]

Read More

Open a New sketch

Under File select New, as shown in the figure. This will open a new, blank sketch, looking like the below.   A new window opens up with the following simple sketch. This is the absolute minimum sketch.   void setup() {   // put your setup code here, to run once:   }   void loop() […]

Read More