HOME - - - - - - - - - Other material for programmers - - - - - - - - - Arduino Tutorial Table of Contents

Arduino Programming: Free, comes- with- system character output.

This is a special Arduino tutorial with no parallel in my related Pascal tutorials.

It addresses the problem of getting text (be it letters or digits) output from an Arduino without buying an LCD panel to display that text.

The good news is that you already have what you need, if you have a working Arduino. There is an answer that comes with the basic system.

The bad news is that the text you can display will be displayed on the big PC you have attached to the Arduino for "feeding" the program into the Arduino. You can't display text on the big PC once it is disconnected, and for most of the jobs I want to program my Arduinos for, the big PC won't be part of the deployed "answer". But that "bad news" isn't as bad as it seems. You don't have to do anything to "turn off" the text output when you disconnect the big PC after the development phase is complete. And the text can be very useful during the development phase.


The Arduino is not as feature rich as my $1000 Linux box! In particular, it would have quite a bit of trouble displaying this page of text, even if it could harvest it from the internet.

But that's okay! It is great for lots of jobs.... especially if they don't require a lot of text to be output. (Letters, digits, punctuation marks, etc.)

However, when you are developing a program, it is a great help if you can put bits of code in which cause little messages to pop up from time to time. Consider the following....

void loop();
{
delay(1000);
delay(2000);
}

"Pretty pointless", I hear you say, and yes, it is... but it is simple, and will not distract you from the point I'm about to make.

If you were working on that "program", and you set it running, how would you know what was going on?

You could add lines to turn various LEDs on and off as the program passed various stages in the execution of your instructions. But typically, the LEDs attached to your Arduino would be busy with other messages. It would be nice to be able to get "I've got to here" messages without interfering with the things you're trying to get working, get doing something else. And there's an answer....

With a little bit of other stuff, the following will work....

void loop()
{
delay(1000);
Serial.println("Just finished delay 1000");
delay(2000);
Serial.println("Just finished delay 2000");
}

.... and when you set the program running, you'll eventually get a screen filled with lots and lots of....

Just finished delay 1000
Just finished delay 2000
Just finished delay 1000
Just finished delay 2000
Just finished delay 1000
Just finished delay 2000
Just finished delay 1000
Just finished delay 2000
Just finished delay 1000
Just finished delay 2000.....

.... lines. They will pop up at the times I hope you would expect.

So! What do you have to do to "turn on" the feature, and where will that text appear?

To turn it on, you only need to add....

Serial.begin(9600);

... to your "setup" function.

(By the way: When you run the program, you may find that the system takes longer than you would expect... say up to 10 seconds from when you think the upload is complete... before it enters the "loop" function.)

So. That's how you arrange for messages from your program, and how you turn them on. Where do they appear?

When the Arduino Development Environment program is running in your big computer, it shows as a window with a menu across the top consisting of "File.. Edit.. Sketch.. (etc)". Below that is a row of icons... a triangle to verify the code, a square to stop it, etc. At the right hand end of that line of icons is a rectangle with a little circle above it. Hover your mouse pointer over it, and you will see "Serial Monitor".

After you have written your program and saved it, and "upload to I/O board"ed it, and seen the "Binary sketch size..." message in the panel at the bottom of the Arduino Development Environment program's window, click on the Serial Monitor icon. Once the Arduino has finished the "setup" function, then you will see the messages you asked for where you once had the "Binary sketch size..." message. Pretty cool! And when you gain the relevant skills, those messages can help you a lot with debugging (I mean feature extending!) your programs.

You are not restricted to simple text. Try the following....

int iCounter = 0;

void setup()
{
Serial.begin(9600);
iCounter = 0; // not really needed, I'm just careful}
}

void loop()
{
Serial.println(iCounter);
delay(500);
iCounter=iCounter+1; //Yes, I know there's a "clever" way to do that.
}

So. There you have a useful tool. You can also use your big PC and its keyboard to send stuff into the Arduino while a program is running in the Arduino, but that's a story for another day!


Please also note that I have two other sites, and that the following search will not include them. They have their own search buttons.

My Sheepdog Guides site.
My Arunet site.

Go to the sites above, and use their search buttons if you want to search them.
To search this site....

Search this site or the web powered by FreeFind

Site search Web search
The search engine merely looks for the words you type, so....
*    Spell them properly.
*    Don't bother with "How do I get rich?" That will merely return pages with "how", "do", "I"....

You can also search this site without using forms.
Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, download something, and circulate it for me? Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.


Want a site hosted, or email? You can also help me if you sign up via this link to 1&1's services. (I wouldn't recommend them unless I was happy after several years as one of their customers, but yes, they do pay me if you use this link! As do the Google advertisers, about whom I know nothing, of course.)



Valid HTML 4.01 Transitional Page WILL BE tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org


Why does this page cause a script to run? Because of the Google panels, and the code for the search button. Also, I have some of my pages' traffic monitored for me by eXTReMe tracker. They offer a free tracker. If you want to try one, check out their site. Why do I mention the script? Be sure you know all you need to about spyware.
Editor's Main Homepage
How to email or write this page's editor, Tom Boyd

....... P a g e . . . E n d s .....