Yesterday, I was on the website looking at shields.
I have some questions.
If I want to use a shield, do I have to specify in code that I want to use a shield? Do I have to specify in code which shield I want to use? Do I need to download any software so that I can use a shield? Can I make my own shield? Are the shields universal, that is they fit all of the Arduinos, except for, I think those that run on 3.3V?
I don't know if I can answer all your question in the best way, but I'll do my best.
A shield is a piece of hardware, but an Arduino is not a pc running windows (or whatever), so you don't need "drivers". You can make your own shield if you like. There are a few shields that are some king of prototyping shields, so it's near one easy way of doing your own shield. After you having your shield (made by you or some that you can buy), you can do the program to "communicate" with it, but you have examples that the manufacturer gives to you. (depending on the shield, you may not need any example, from the manufacturer, for example if you have one shield with 4 buttons and 4 led's, you can peak the examples in the Arduino IDE)
I believe that I answer all the questions, but one, "Are the shields universal, that is they fit all of the Arduinos, except for, I think those that run on 3.3V?". I don't have very sure, but I think that you have 2 different types of Arduino shields. The difference is not the power source, but is the distance between the rows of pins. The pins in the different types of Arduino board are all in the same position, so you don't need to care about doing connections, they are already made, and the connections for Arduino UNO are the same that for Arduino Mega, etc.
Think of a shield as just a convenient way of hooking up components, without having to use lots of jumper wires and breadboard etc etc.
What you may find you need of course, is some or other library to manage the components on the shield. But you would need those any way. Ok, maybe not "need", since things can be done without libraries, but libraries make things easier.
So if you used for example an LCD, you would find it easier to use the library. If it's a "loose" LCD, you would have to wire it up with jumper wires and so on. If it's on a shield, it just plugs in. Then you use the same library to drive the LCD.
If you use an Ethernet shield, you would use the Ethernet library. But you use the library to drive the components, not the shield as such.
Arduino doesn't "know" the LCD's on a shield plugged in on top, or on a breadboard through miles of wire.
I figured that I'd have to use a library. Are the libraries on the Arduino website? How do I include them in the code? Since the programming language for the sketches is C++, would one have to include an "include" statement in the code? Can 2 or more shields be stacked on top of the Arduino?
What would be an example of the use of an Ethernet shield? The Arduino doesn't have video out so how would one use an Ethernet shield?
Macnerd:
What would be an example of the use of an Ethernet shield? The Arduino doesn't have video out so how would one use an Ethernet shield?
Why would Ethernet rely on video out?
I set mine up for a simple home automation server. Read a temperature sensor and an RTC, and display their results on a webpage, which also has a few buttons to turn stuff off and on.
There's sample code in the IDE: File > Examples > Ethernet, and have a dig round the playground. Here's a tutorial.
Why would Ethernet rely on video out? I set mine up for a simple home automation server. Read a temperature sensor and an RTC, and display their results on a webpage, which also has a few buttons to turn stuff off and on.
I hadn't thought of that.
It is very evident to me that I have a lot to learn about the Arduino's capabilities!
"I figured that I'd have to use a library. Are the libraries on the Arduino website? How do I include them in the code? Since the programming language for the sketches is C++, would one have to include an "include" statement in the code? Can 2 or more shields be stacked on top of the Arduino?"
After I sent the post, I googled "DIY Arduino shield" & found out that I can create my own shield. I suppose that I can write my own library, right? I would need a C or C++ compiler, right?
I've never written a library so I have no idea on the mechanics of that. But forum members post new ones all the time, it's very common.
You may find some guidelines in the forum or maybe the playground; else post a specific "how do I create a library" question, I'm sure you'll get many replies.