O'Reilly logo

Building Wireless Sensor Networks by Robert Faludi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Program the Arduino

The Twitter Reader uses the Arduino sketch shown later in this section. You’ll also need the NewSoftSerial library.

Installing the NewSoftSerial library

Download the library from http://arduiniana.org/libraries/newsoftserial and unzip it. It will be in a NewSoftSerial folder that contains NewSoftSerial.h, NewSoftSerial.cpp, keywords.txt, and an Examples subfolder.

Open your Arduino sketchbook folder (if you’re not sure where this is, open a saved sketch, choose SketchShow Sketch Folder, then go up to its parent directory). There is probably already a folder there called libraries, but if not you can create one. Place the entire NewSoftSerial folder inside the libraries folder.

If Arduino is already running, quit it and then start it up again. You should see NewSoftSerial listed on the SketchImport Library menu.

Warning

If you get a message like error: NewSoftSerial.h: No such file or directory when you compile your program or load it, you probably don’t have a folder in the right place. Try going through the above instructions again or check http://www.arduino.cc/en/Reference/Libraries for more information on adding libraries to Arduino.

Once you’ve loaded the files and directories onto your computer, open Twitter_Reader.pde (full code listed below, or you can download it from the website listed in the Preface) in Arduino, press the Upload button (labeled with a right arrow) to upload the code to your Arduino. The code will run and should briefly show ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required