The second chapter, , introduces the Arduino Leonardo. The Leonardo is a different sort of Arduino, because the USB controller is implemented in software, and not in a separate chip as had been the case prior to the Leonardo. This allows the USB behaviour of the board to be modified.
The Third Edition is written for version 1.0.5 of the IDE. In anticipation of the imminent release of version 1.5, differences between 1.0.5 and 1.5 have been noted.
Numerous suggestions from students and readers have been incorporated.
In keeping with the spirit of the original text, British spelling is used throughout.
Preface to the Second Edition
A few years ago I was given a very interesting challenge: teach designers the bare minimum in electronics so that they could build interactive prototypes of the objects they were designing.
I started following a subconscious instinct to teach electronics the same way I was taught in school. Later on I realised that it simply wasnt working as well as I would like, and started to remember sitting in a class, bored like hell, listening to all that theory being thrown at me without any practical application for it .
In reality, when I was in school I already knew electronics in a very empirical way: very little theory, but a lot of hands-on experience.
I started thinking about the process by which I really learned electronics:
- I took apart any electronic device I could put my hands on.
- I slowly learned what all those components were.
- I began to tinker with them, changing some of the connections inside of them and seeing what happened to the device: usually something between an explosion and a puff of smoke.
- I started building some kits sold by electronics magazines.
- I combined devices I had hacked, and repurposed kits and other circuits that I found in magazines to make them do new things.
As a little kid, I was always fascinated by discovering how things work; therefore, I used to take them apart. This passion grew as I targeted any unused object in the house and then took it apart into small bits. Eventually, people brought all sorts of devices for me to dissect. My biggest projects at the time were a dishwasher and an early computer that came from an insurance office, which had a huge printer, electronics cards, magnetic card readers, and many other parts that proved very interesting and challenging to completely take apart.
After quite a lot of this dissecting, I knew what electronic components were and roughly what they did. On top of that, my house was full of old electronics magazines that my father must have bought at the beginning of the 1970s. I spent hours reading the articles and looking at the circuit diagrams without understanding very much.
This process of reading the articles over and over, with the benefit of knowledge acquired while taking apart circuits, created a slow, virtuous circle.
A great breakthrough came one Christmas, when my dad gave me a kit that allowed teenagers to learn about electronics. Every component was housed in a plastic cube that would magnetically snap together with other cubes, establishing a connection; the electronic symbol was written on top. Little did I know that the toy was also a landmark of German design, because Dieter Rams designed it back in the 1960s.
With this new tool, I could quickly put together circuits and try them out to see what happened. The prototyping cycle was getting shorter and shorter.
After that, I built radios, amplifiers, circuits that would produce horrible noises and nice sounds, rain sensors, and tiny robots.
Ive spent a long time looking for an English word that would sum up that way of working without a specific plan, starting with one idea and ending up with a completely unexpected result. Finally, tinkering came along. I recognised how this word has been used in many other fields to describe a way of operating and to portray people who set out on a path of exploration. For example, the generation of French directors who gave birth to the Nouvelle Vague were called the tinkerers. The best definition of tinkering that Ive ever found comes from an exhibition held at the Exploratorium in San Francisco:
Tinkering is what happens when you try something you dont quite know how to do, guided by whim, imagination, and curiosity. When you tinker, there are no instructionsbut there are also no failures, no right or wrong ways of doing things. Its about figuring out how things work and reworking them.
Contraptions, machines, wildly mismatched objects working in harmonythis is the stuff of tinkering.
Tinkering is, at its most basic, a process that marries play and inquiry.
From my early experiments I knew how much experience you would need in order to be able to create a circuit that would do what you wanted, starting from the basic components.
Another breakthrough came in the summer of 1982, when I went to London with my parents and spent many hours visiting the Science Museum. They had just opened a new wing dedicated to computers, and by following a series of guided experiments, I learned the basics of binary math and programming.
There I realised that in many applications, engineers were no longer building circuits from basic components, but were instead implementing a lot of the intelligence in their products using microprocessors. Software was replacing many hours of electronic design, and would allow a shorter tinkering cycle.
When I came back, I started to save money, because I wanted to buy a computer and learn how to program.
My first and most important project after that was using my brand-new ZX81 computer to control a welding machine. I know it doesnt sound like a very exciting project, but there was a need for it and it was a great challenge for me, because I had just learned how to program. At this point, it became clear that writing lines of code would take less time than modifying complex circuits.