Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
public:crocs:arduino [2014-10-24 22:53] – lnemec | public:crocs:arduino [2014-10-29 09:16] – [OpenLab 2014/07 | Hands on Arduino] mukrop | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Arduino ====== | + | ====== |
+ | |||
+ | * Date: 31. 10. 2014 | ||
+ | * Workshop by: Lukáš Němec | ||
+ | * Cake: we will see... | ||
+ | * Cake by: Mirek Jaroš | ||
+ | * Discussion on A403 wallpainting | ||
+ | |||
+ | ===== What to expect ===== | ||
+ | |||
+ | Introduction to microcontroller programming, | ||
+ | |||
+ | As we learn enough of theoretic background, you will get your hands on Arduino boards and you will have chance to program your own blinking LED or something similar, depending on your time, skill and enthusiasm. | ||
===== What to prepare ===== | ===== What to prepare ===== | ||
Line 23: | Line 35: | ||
===Analog pins=== | ===Analog pins=== | ||
- | Analog pins are used for analog read, when we need more precise value than just binary 0 or 1. Output from these pins can be anything between 0 to 1023 and we use these pins for reading values from sensors, | + | Analog pins are used for analog read, when we need more precise value than just binary 0 or 1. Output from these pins can be anything between 0 to 1023 and we use these pins for reading values from sensors, e.g. humidity, ligth, distance etc. |
=== Power and special pins === | === Power and special pins === | ||
Line 29: | Line 41: | ||
Last category of pins are power pins, these are ground pins, 5V and 3.5V pins. Connect these to power breadboard power lines or components directly, as needed. | Last category of pins are power pins, these are ground pins, 5V and 3.5V pins. Connect these to power breadboard power lines or components directly, as needed. | ||
- | All other pins are used for special purposes, like reset pin or in case of smaller or older versions of arduino for actual programming. | + | All other pins are used for special purposes, like reset pin or in case of smaller or older versions of arduino for actual programming |
<note important> | <note important> | ||
Line 48: | Line 60: | ||
===== Arduino code basics ===== | ===== Arduino code basics ===== | ||
Programming for arduino is basically C language with some specific commands and libraries. | Programming for arduino is basically C language with some specific commands and libraries. | ||
+ | |||
+ | === Introduction === | ||
Smallest code, that sucessfully compiles looks like this: | Smallest code, that sucessfully compiles looks like this: | ||
Line 59: | Line 73: | ||
</ | </ | ||
Here you have two functions, one for initial setup of variables, pins etc, and loop function that runs in infinite loop after setup as it's name suggests. | Here you have two functions, one for initial setup of variables, pins etc, and loop function that runs in infinite loop after setup as it's name suggests. | ||
+ | |||
+ | === Blinking LED === | ||
Now for some code, that actually does something usefull (blinking LED): | Now for some code, that actually does something usefull (blinking LED): |