Академический Документы
Профессиональный Документы
Культура Документы
http://ocw.ump.edu.my
ARDUINO by
Marlina Yakno
Expected Outcome
ARDUINO by
Marlina Yakno
Chapter Outline
Item Sub-topic
10.1 Data Acquisition Card Type and Function
10.2 Terminal Port Testing
11.1 Hardware Connection with Interface Card
11.2 Port Selection and Configuration
11.3 Digital Input & Output
11.4 Analog Input & Output
ARDUINO by
Marlina Yakno
Arduino Uno
ARDUINO by
Marlina Yakno
Introduction to Arduino Uno
ARDUINO by
Marlina Yakno
Introduction to Arduino Uno
ARDUINO by
Marlina Yakno
Training Kit:
1. LED 6 unit :
connected to Digital
pin 5-10
2. Resistor 220 ohm - 6
unit
3. Resistors 10K ohm
2 unit
4. Push button switch -
2 unit connected to
Digital pin 11 & 12
5. LM35 sensor - 1 unit
connected to A0
6. Potentiometer 1
unit connected to A1
ARDUINO by
Marlina Yakno
Download & Install Arduino IDE
ARDUINO by
Marlina Yakno
Open Arduino IDE
ARDUINO by
Marlina Yakno
Selecting the board
ARDUINO by
Marlina Yakno
Check computer port
ARDUINO by
Marlina Yakno
Select the right port
ARDUINO by
Marlina Yakno
The Arduino
IDE
Display communication
message between PC and
Arduino and list any errors
if your sketch doesn't
compile properly
ARDUINO by
Marlina Yakno
Setup() & loop() Functions
setup()
loop()
File->Examples
ARDUINO by
Marlina Yakno
Loading Program to Arduino Board
Press the upload button (see the button with right arrow
mark). It will begin the process of burning the compiled
program to Avr micro controller on Arduino board.
Objective:
Turns an LED on for one second,
then off for one second,
repeatedly.
Parts Required:
- Arduino board
- 6 LEDs (connected to Digital
pin 5-10
- 220 resistors
ARDUINO by
Marlina Yakno
ACTIVITY 1: LED BLINKING
ARDUINO by
Marlina Yakno
pinMode()
Description: Configures the specified pin to behave
either as an input or an output.
Syntax: delay(ms)
ARDUINO by
Marlina Yakno
ACTIVITY 2: CHANGE BLINKING
PATTERN
a. Modify the blinking coding
so that now it turn ON for 3
seconds and turn OFF 1
second.
ARDUINO by
Marlina Yakno
ACTIVITY 3: ADD MORE LEDs
ARDUINO by
Marlina Yakno
ACTIVITY 4: PUSHBUTTON-
CONTROLLED LED
Objective:
Turns on and off LED when
pressing a pushbutton.
Parts Required:
- Arduino board
- LED (connected to Digital pin
5-10
- 220, 10k resistors
- Push button switch
(connected to Digital pin 11-
12)
ARDUINO by
Marlina Yakno
ACTIVITY 4: PUSHBUTTON-
CONTROLLED LED
ARDUINO by
Marlina Yakno
ACTIVITY 5: PUSHBUTTONS-
CONTROLLED LEDs
Use button 1 to control LED
1 and button 2 to control
LED 2
ARDUINO by
Marlina Yakno
Analog Input
analogRead()
Reads the value from the specified analog pin.
Syntax: analogRead(pin)
Parameters:
pin: the number of the analog input pin to read from (0 to 5 on most
boards, 0 to 7 on the Mini and Nano, 0 to 15 on the Mega)
Returns an integer ranging from 0 to 1023
ARDUINO by
Marlina Yakno
ACTIVITY 6: LIGHT DIMMER
Objective:
The brightness of the LED is
controlled by the potentiometer.
Parts Required:
- Arduino board
- LED (connected to Digital pin
5-10
- 220, 10k resistors
- Potentiometer(connected to
Analog pin 1)
ARDUINO by
Marlina Yakno
ACTIVITY 6: LIGHT DIMMER
ARDUINO by
Marlina Yakno
ACTIVITY 7: BAR GRAPH
Use potentiometer to
control all LEDs at Arduino
board.
ARDUINO by
Marlina Yakno