Professional Documents
Culture Documents
Arduino/Gizduino Quick Start: Engr. Roma L. Mercado RND Engineer/Technical Support at E-Gizmo Mechatronix Central
Arduino/Gizduino Quick Start: Engr. Roma L. Mercado RND Engineer/Technical Support at E-Gizmo Mechatronix Central
Arduino/Gizduino Quick Start: Engr. Roma L. Mercado RND Engineer/Technical Support at E-Gizmo Mechatronix Central
egizmo.technical@gmail.com
Outline
●
Know what is a microcontroller
●
What is Arduino/Genuino
●
Hardware Specifications
Objectives
Introduction to GizDuino
To know what is Gizduino
Learn how to program Gizduino
What is a microntroller?
Small computer on a single IC
Configurable pins
Programmable Function
With Built-in Memory RAM, ROM
Has Built-in Peripherals
- Timer,ADC,UART/SPI/I2C/PWM/Comparators
ATMEGA328/328P
Microcontroller Developed by Atmel
Widely used on Arduino
8-bit Microcontroller
28 pins
32 Kbytes Flash Memory “Self-programmable”
Basic Setup
●
Atmega 328 IC DIP 28
●
Breadboard
●
Supply
●
Crystal Oscillator
●
Resonator Bypass
●
Reset Pull-up
●
Filter Capacitor
●
Bypass Capacitor
●
Reset Switch
●
ADC Supply
ATmega328P
23 pins General Purpose I/Os
Outputs
Outputs
●
LED
●
Transistor
●
Buzzer
●
DC Motor
●
Servo Motor
●
Sensor
INPUTS
●
ADC -switch
- Voltage measurement
- LDR
SENSOR
- Temperature -
Proximity
- Position
What is Arduino?
A project which began in Ivrea (Italy) in 2003
Device for controlling student-built interaction
design
- it is less expensive
- more modern
- than what is available
- Basic Stamp
Who is Arduino?
Arduino
Open Source Hardware
- Based on Wiring
Open Source Software
- Based on Processing
Multi-platform (Windows, Mac, Linux)
Programmed via USB
●
Named the project after a local bar Arduin of Ivrea
- Italian masculine first name
- “strong friend”
- English equivalent is “Hardwin”
What is Gizduino?
It is an Open-Source physical computing
platform based on a simple input/output
(I/O)board and the use of standard
programming language.
It is a tool for implementing a program you have
designed.
Gizduino is programmed using the IDE
(Integrated Development Environment).
An Arduino Compatible
Gizduino V (Atmega328P) v5.0
GizDuino V
(Atmega 168P or 328P)
20 I/Os
16/32kB Flash memory
*UART Automatic Switch
Arduino VS GizduinoV
Driver : FTDI Driver :Prolific
GizDuinoPLUS
(Atmega 164P/324P/644P)
32 I/Os
16/32/64kB Flash memory
*UART Automatic Switch
Arduino VS GizduinoPLUS
GizDuino mini
(Atmega 168P or 328P)
W/ or w/o pins
Gizduino PLUS mini Board
Device Driver
- GizduinoPLUS uses Prolific Chip
http://www.prolific.com.tw/US/ShowProduct.as
px?p_id=225&pcid=41
Install the Prolific Driver
Open arduino 1.0.6 folder > driver folder >
prolific USB drivers >
PL2303_Prolific_Driver_Installer.exe
Open the Arduino IDE
Click the Arduino IDE application
Arduino IDE
Connect GizduinoPLUS to PC
Connect the Gizduino board to your PC using
USB Cable (TypeA - TypeB mini). The green
and red power LED should turn on.
Open the Blink sketch
●
File>Examples>Basics>Blink.ino
Select the board
Tools>Board menu and select “Gizduino + w/
ATmega644”
Getting Up and Running
Tools> Serial Port menu and Select COM #
Uploading the Program
Click “Upload” to verify the code and upload the
sketch to your board.
Sample Blink sketch
If the blink sketch is successfully uploaded,
The Message “Done Uploading” appear in the
status bar
Success!
Now the Program is running to the board, LED
turning alternately ON and OFF.
Blink Test
Blink Sketch
Arduino Programming
Operators
Variables
Arduino Programming
Setup()
- called when a sketch starts running
- to initialize
Libraries,variables, pinModes,
The setup function runs once when you
press reset or power the board.
Setup()
int LEDpin = 13;
void setup(){
pinMode(LEDpin, OUTPUT);
digitalWrite(LEDpin, LOW);
}
void loop(){
}
loop()
- Executed reapeatedly
- Allows the program to change and respond.
The loop function runs over and over
again forever
loop()
int LEDpin = 13;
void setup(){
pinMode(LEDpin, OUTPUT);
}
void loop(){
digitalWrite(LEDpin, HIGH); delay(100);
digitalWrite(LEDpin, LOW); delay(100);
}
pinMode
●
pinMode(pin, mode)
-set a digital pin as an input or an
output.
pin – the number to set
Digital: 0-19 ;Analog:A0-A5
mode – either INPUT or OUTPUT
●
ex.pinMode(13, OUTPUT);
digitalWrite
●
digitalWrite(pin, value)
-for digital: HIGH or LOW
pin – the number to set
Digital: 0-19 ;Analog:A0-A5
value – either HIGH or LOW
●
ex.digitalWrite(13, HIGH);
delay(ms)
●
delay(value)
-amount of time to pauses the program
(milliseconds)
1 second = 1x10-3 seconds =1000ms
●
ex.delay(1000);
Review
(+)
Anode Cathode
(+) (-)
Activity #1
With the LED turned on, the light pauses for
1second and pause again for 100ms
while the LED is off.
Activity #2
Create a blinking LED wave like running lights. We'll
use eight LEDs.
Digital pins11,10,9,8,7,6,5,4
Switch
Button switches connect two points in a circuit
when you press the button, the LED (or whatever)
is turned ON (if it's off) or OFF (if on).
Latch – change state and retain it until the next
change state.
Switch
Latching
- Button 1: pin 2
- LED1: pin10
Button Switch
- Button 2: pin 3
- LED2: pin 11
Switch
Questions?
THANK YOU FOR COMING!