This is an Introduction to Arduino and Hands on to Iot .
were u can know about the IOT and Arduino .
And also provide an hands on to the user in iot and Arduino uno.
4. The Arduino is an …
single-board microcontroller, intended to make the application of interactive objects
or environments more accessible .
Designed to make the process of using electronics multidisciplinary projects more
accessible.
5. Arduino can…
Sense the environment by receiving input from variety of sensors.
Affect its surroundings by controlling lights, motors, and other actuators.
10. Setting Up IDE
Check out: http://arduino.cc/en/Guide/HomePage
1. Download & install the Arduino environment (IDE).
2. Connect the board to your computer via the USB cable.
3. If needed, install the drivers.
4. Launch the Arduino IDE.
5. Select your board.
6. Select your serial port.
7. Open the blink example .
8. Upload the program.
16. Programming Environment
The Arduino Uno can be programmed with the Arduino software IDE(integrated
development environment) .
The Atmega328 on the Arduino Uno comes preburned with a Bootloader that allows
you to upload new code to it without the use of an external hardware programmer.
You can also bypass the Bootloader and program the microcontroller through the
ICSP (In-Circuit Serial Programming) header.
Arduino IDE works on windows , linux as well as Mac lion X platforms.
19. Data Types and operators
Integer: used with integer variables with value between
2147483647 and -2147483647.
Ex: int x=1200;
Character: used with single character, represent value from -
127 to 128.
Ex. char c=‘r’;
Long: Long variables are extended size variables for number
storage, and store 32 bits (4 bytes), from -2,147,483,648 to
2,147,483,647.
Ex. long u=199203;
Floating-point numbers can be as large as 3.4028235E+38
and as low as -3.4028235E+38. They are stored as 32 bits (4
bytes) of information.
Ex. float num=1.291; [The same as double type]
20. Statement and operators:
Statement represents a command, it ends with ;
Ex:
int x;
x=13;
Operators are symbols that used to indicate a specific function:
- Math operators: [+,-,*,/,%,^]
- Logic operators: [==, !=, &&, ||]
- Comparison operators: [==, >, <, !=, <=, >=]
Syntax:
; Semicolon, {} curly braces, //single line comment,
/*Multi-line comments*/
23. Control statements:
Switch case:
switch (var) {
case 1:
//do something when var equals 1
break;
case 2:
//do something when var equals 2
break;
default:
// if nothing else matches, do the default
// default is optional
}
25. Code structure:
Void setup()
{
//Used to indicate the initial values of system on starting.
}
Void loop()
{
//Contains the statements that will run whenever the system is powered after setup.
}
26. Input and output:
Led blinking example:
Used functions:
pinMode();
digitalRead();
digitalWrite();
delay(time_ms);
other functions:
analogRead();
analogWrite();//PWM.
30. Final thoughts
Arduino is a cheap and versatile open source prototyping environment
It is basically designed for novice , non technical people
Programming language is simple
Arduino has a terrific community support and documentation
Technical people can use Arduino for testing sensors or other
prototyping work