This page covers some points which apply to the family of pages of which it is a part.
Much of what you read here "should" not be important... but if you've used computers for a week, you know that "little details" can matter. Sigh.
The other pages in the family mostly address the use of specific elements of the excellent (c.$16, 7/10) datalogging shield for Arduinos, which was produced for us by nuelectronics.com. They also sell a useful range of sensors and accuators (effectors), already wired up so you can just plug them into the shield, at reasonable prices. Much of the material in this family of pages can be used by a shield owner to integrate sensors, etc into his project. The information can also be useful to sensor owners integrating the sensors into other projects, even without the nuelectronics shield.
Let's consider the page about using the DS18B20 temperature sensor as an example of how I was working while writing the tutorials.
... and that's about it! However, that may be a little bit different from what the writers of the demo software nuelectronics was supplying in June 2010... and the differences matter in some instances. And let's look a little at the bits relating to the serial monitor, in case you aren't old friends.
Forget about the shield and the temperature sensor for a moment.
If you ran the following in an Arduino, it would display "Hello world" somewhere. If you know where, skim for a bit... but there's more, even for you, in a moment.
void setup(){ Serial.begin(9600); } void loop(){ Serial.println("Hello World"); }
The two lines starting "Serial." are to do with "the serial monitor". If you just want to wink some LEDs, you don't need to know about the serial monitor, and if you are a beginner you may not have seen it yet. It is "hidden" until you "turn it on"... but it is always available, and a very useful tool it is!
To see it in action: Put the little "Hello world" example into your Arduino. Wait for the message "Done uploading" to appear on the bar between the panel you typed the code into and the messages area below, where you hope to see "Binary sketch size...", the message that says your code had no syntax errors.
After you've been told the development environment is done uploading, if you click on the right hand icon of the toolbar... the one that is a rectangle with a vertical line out the top to a tiny circle, the one that gives rise to the "Serial Monitor" message just to it's right when you put the mouse pointer on the icon... if you click it, a new window should open, and a moment later your "Hello World" should appear.
(A little "gotcha": If you are impatient, if you click the Serial Monitor icon before the "Done Uploading" message, nothing happens. The system isn't broken. You just can't have the serial monitor until your code has been uploaded to your Arduino.)
(Another little "gotcha": The number in "Serial.begin(9600);" must be the same as the "baud" number in the lower left of the serial monitor window. The nuelectronics programs use different numbers in the equivalent places. Don't hesitate to change them to suit the details of how you are working. If you are getting gibberish, especially if simple text headers are scrambled, look for a mis-match between your program and the settings in effect for your serial monitor. (They are changed by the "baud" window... and elsewhere.... but you "shouldn't" have this problem if you can upload programs to the Arduino, and the "Serial.begin" lines in them have the right number.)
Not only does the serial monitor give you a place to display messages from the Arduino, it also gives you a way to send messages to it. Those messages are only sent after you press "enter"... they are not sent character by character as you type the message. The "get_line" subrouting which is part of many of my demo programs is at the heart of using messages from the user. It was adapted from the "get_line" in the nuelectronics demo programs. It uses some techniques which, frankly, somewhat puzzle me... but it works!... when you work as I did. E.g. via the serial monitor, etc.
I suspect that the nuelectronics people were interacting with their Arduino via a separate terminal program. In the Windows world, Hyperterminal used to be "standard", used to routinely be supplied with the operating system. Nowadays, I think that the free "PuTTY" is the program I'd use for such things. (I've done a write up of PuTTY and other good freeware elsewhere.)
You may be able to get away with having two things connected to your Arduino at the same time... the developement environment and Hyperterminal... but it makes me nervous. Hence my preference for working via the serial terminal. Apologies for any difficulties this gives rise to. They should, I hope, be restricted to needing to tweak "get_line" and how you interact with what's in your Arduino and shield, while working with the demos. These issues become largely moot in any "real" application of the hardware.
As a general rule, I prefer not to clutter my system with libraries. In a some cases, you will need libraries to work with the demos I've done. In each case, I hope the library needs are clear in the text of the specific demo. You do not, by the way, need to install the library for Dallas "1-wire" chips, supported by the general Arduino community.
I will try to produce a separate beginner's guide to general "use of libraries" points. (If ar3ne1lib.htm has become available, please remind me to edit this page!)
A detail, which I've discussed again on ar3ne1onetwo.htmits own page... You will see "one wire" and "one wire interface" in the nuelectronics documentation. This is not always connected with "1-Wire" (a Dallas trademark) at all, and even when you are connecting a 1-Wire device to a nuelectronics "one wire" connection point, you won't often (ever?) get dragged into some of the more complex 1-Wire issues. Don't get me wrong... I like 1-Wire... it is powerful. But to get everything you can from 1-Wire gets dangerously close to Serious Work. nuElectonics lets you use some of the (marvelous) 1-Wire devices without the work!
Forgive the abrupt end... I want to write up the tutorial on using the SD card reader/writer... you'd rather I did that than polish this, wouldn't you?
-------------------
Further to the Arduino ideas the page you are reading now will take you to, I have posted a series of essays which try to help you become a better Arduino programmer and engineer... but, for the best result, you will have to buckle down and work your way through them in sequence. The "How To's" here can be accessed in whatever order you like.
Feel free to use this information in programming courses, etc, but a credit of the source would be appreciated. If you simply copy the pages to other web pages you will do your readers a disservice: Your copies won't stay current. Far better to link to these pages, and then your readers see up-to-date versions. For those who care- thank you- I have posted a page with more information on what copyright waivers I extend, and suggestions for those who wish to put this material on CDs, etc.
See the discussion near the bottom of the "top level" page covering the bulk of my Arduino contributions. There is information there, too, about things like "May I copy your material?", and the system of file names I am trying to work to.
If you visit 1&1's site from here, it helps me. They host my website, and I wouldn't put this link up for them if I wasn't happy with their service... although I was less than pleased the other day to have what I was doing interrupted by a telephone call from their sales team, trying to get me to extend my involvement. Sigh. Hardly a rare event, but I'd thought 1&1 were a bit classier that some of the people who have my telephone number.
Click here to visit editor's Sheepdog Software (tm) freeware, shareware pages.
Click here to visit the homepage of my biggest site.
Click here to visit the homepage of Sheepdogsoftware.co.uk. Apologies if the "?Frmar3ne1ser" I added to that link causes your browser problems. Please let me know, if so?
Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org
....... P a g e . . . E n d s .....