Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
public:crocs:arduino [2014-10-24 22:55] – [Arduino code basics] headlines added lnemecpublic:crocs:arduino [2014-10-29 11:37] lnemec
Line 1: Line 1:
-====== Arduino ======+====== OpenLab 2014/07 | Hands on 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, focused mainly on Arduino platform. We will start with basics, what to expect from Arduino and what is Arduino capable of with some examples. Then theoretic part, how to connect everything together and mainly how to write programs. Thus everything from using basic C skills to Arduino specific functions.  
 + 
 +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, i.e. humidity, ligth, distance etc.+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 (USB interface is not present).
  
 <note important>Reset pin is usually present also in form of a button on board, this can be used for reinitializing state of your code back to setup function.</note> <note important>Reset pin is usually present also in form of a button on board, this can be used for reinitializing state of your code back to setup function.</note>
Line 91: Line 103:
  
 {{ :public:crocs:arduino:led_blink.png?direct&700 |}} {{ :public:crocs:arduino:led_blink.png?direct&700 |}}
 +
 +=== Sensors, Analog input and Serial monitor ===
 +
 +Next example will show, how to read values from sensors and how to obtain debugging information from Arduino board.
 +
 +In order to receive value from sensor, we have to use analog input pins (Arduino UNO has range from A0 to A5) and read values with analogRead function. There are many posibilities what to use as a source of input, you can choose from whatever is avaiable, rotary potentiometer