If you have done any plumbing at home, electronics won’t be a problem for you to understand. To understand how electricity and electric circuits work, the best way is to use something called the water analogy. Let’s take a simple device, like the battery-powered portable fan shown in Figure 4-3. If you take a fan apart, you will see… Continue reading What Is Electricity?
Month: November 2022
What We Will Be Building
I have always been fascinated by light and the ability to control different light sources through technology. I have been lucky enough to work on some interesting projects that involve controlling light and making it interact with people. Arduino is really good at this. We will be working on how to design interactive lamps, using Arduino… Continue reading What We Will Be Building
The Code, Step by Step
At first, you might consider this kind of explanation too unnecessary, a bit like when I was in school and I had to study Dante’s Divina Commedia (every Italian student has to go through that, as well as another book called I promessi sposi, or The Betrothed—oh, the nightmares). For each line of the poems, there were a hundred lines… Continue reading The Code, Step by Step
Real Tinkerers Write Comments
Any text beginning with // is ignored by Arduino. These lines are comments, which are notes that you leave in the program for yourself, so that you can remember what you did when you wrote it, or for somebody else, so they can understand your code. It is very common (we know this because we do it all… Continue reading Real Tinkerers Write Comments
Arduino Is Not for Quitters
Arduino always expects that you’ve created two functions: one called setup() and one called loop(). setup() is where you put all the code that you want to execute once at the beginning of your program, and loop() contains the core of your program, which is executed over and over again. This is done because Arduino is not like your regular computer—it… Continue reading Arduino Is Not for Quitters
Pass Me the Parmesan
Notice the presence of curly braces, which are used to group lines of code together. These are particularly useful when you want to give a name to a group of instructions. If you’re at dinner and you ask somebody, “Please pass me the Parmesan cheese,” this kicks off a series of actions that are summarised… Continue reading Pass Me the Parmesan
Blinking an LED
The LED blinking sketch is the first program that you should run to test whether your Arduino board is working and is configured correctly. It is also usually the very first programming exercise someone does when learning to program a microcontroller. A light-emitting diode (LED) is a small electronic component that’s a bit like a lightbulb, but… Continue reading Blinking an LED
Sensors and Actuators
Sensors and actuators are electronic components that allow a piece of electronics to interact with the world. As the microcontroller is a very simple computer, it can process only electric signals (a bit like the electric pulses that are sent between neurons in our brains). For it to sense light, temperature, or other physical quantities,… Continue reading Sensors and Actuators
Anatomy of an Interactive Device
All of the objects we will build using Arduino follow a very simple pattern that we call the interactive device. The interactive device is an electronic circuit that is able to sense the environment by using sensors (electronic components that convert real-world measurements into electrical signals). The device processes the information it gets from the sensors with behaviour… Continue reading Anatomy of an Interactive Device
Port Identification: Linux
Invoke the Arduino IDE by typing: From the Tools menu in the Arduino IDE, select Serial Port. You will see one or more serial ports with names like /dev/tty. One of the ports will say Arduino/Genuino Uno following the port name. This is the one to select. Once you’ve figured out the serial port assignment,… Continue reading Port Identification: Linux