3.6 Arduino -IDE Programming.pptx
3.6 Arduino -IDE Programming.pptx
UNIT 3
3.1 Introduction to the Concept of IoT Devices
3.2 IoT Devices Versus Computers
3.3 IoT Configurations - Basic Components
3.4 Introduction to Arduino – Types of Arduino
3.5 Arduino Toolchain
3.6 Arduino Programming Structure – Sketches – Pins –
Input/Output From Pins Using Sketches
3.7 Introduction to Arduino Shields
3.8 Integration of Sensors and Actuators with Arduino.
from https://www.arduino.cc/en/Main/Software
Arduino IDE
Steps in Arduino Programming
1. Download & install the Arduino environment (IDE)
Arduino IDE
Steps in Arduino Programming
2. Connect the board to your computer via the UBS cable
Arduino IDE
Toolbar
• Verify
✔ Checks code for errors compiling it
• Upload
✔ Compiles and uploads code to the Arduino I/O board
• New
✔ Creates a new sketch
• Open
✔ Open sketch
• Save
✔ Save sketch
• Serial Monitor
✔ Display serial data being sent from the Arduino board
Module 4 – Building IoT with Galileo/Arduino 9
Session 3 - Arduino IDE 18IT067 – Internet of Things
Arduino IDE
Using Arduino
• Write the sketch
• Press Compile button (to check for errors)
• Press Upload button to program Arduino
Arduino IDE
Steps in Arduino Programming
7. Upload the program
12
Session 3 - Arduino IDE 18IT067 – Internet of Things
Arduino IDE
Steps in Arduino Programming
8. After Uploading
Arduino IDE
Terminology
• Sketch
✔ A program written to run on an Arduino board
• Pin
✔ An input or output connected to something. E.g., output to an LED, input
from a knob
• Digital
✔ Value is either HIGH or LOW. (aka on/off, one/zero) E.g., switch state
• Analog
✔ Value ranges, usually from 0 – 255. E.g., LED brightness, motor speed, etc.
Arduino IDE
Arduino IDE
Basic Software Functions
If-then-else
For Lop
Arduino IDE
Basic Software Functions
Switch
Arduino IDE
Some Other Basic Functions
• delay(ms)
✔ Pauses for a few milliseconds
• delayMicroseconds(us)
✔ Pauses for a few microseconds
Arduino IDE
Summary
• Arduino Integrated Development Environment (IDE)
• Steps in Arduino Programming
• Using Arduino
• Adding an External LED to pin 13
• Toolbar
• Arduino Code
• Terminology
• Basic Hardware Functions
• Basic Software Functions
• Some Other Basic Functions
Arduino IDE
Try Yourself
• Is Arduino IDE open source?
• Determine the best Arduino IDE.
• Find the language used by Arduino IDE.
• Does Arduino IDE use Java?
• Can I use Visual Studio for Arduino?
Arduino IDE
Try Yourself
• Find the 8 words related to Arduino IDE
E C R U O S N E P O
A V L A T I G I D B
S K E T C H F T M G
G N F R P J E B F I
D O K D I Q D K S U
K G L C N F Q V P W
A J D A H L Y L R H
L H B M N R O U T C
D E L A Y A P C G D
C F K I D J G B J A