Introduction Easy and Fast Arduino For Beginners To Advanced
Introduction Easy and Fast Arduino For Beginners To Advanced
Arduino UNO
ATMega328
What is this Arduino?
Starting Eclipse
Das blinkenlights
Switching to Release Build
How to Optimize Arduino?
Uploading your Program to the Arduino
Final result!
Interfacing LCDs with Arduino
Introduction
Character and LCD Graphics
Character LCD
LCD Graphics
Code Project
Ski
Ski2
Conclusion
Introduction to the Arduino
Hardware Platform
Introduction
Background
Blinking
Metronome
YYZ
Debugging Arduino Sketch
Conclusion
Automation Solution Using
Arduino
Motivation
Arduino Mega 2560
Wiring Setup
Using Code Arduino
Code Test Results Arduino
Password Safe Built With Arduino
Introduction
Hardware
Using code
Arduino UNO
1. Mulai Eclipse
Figure 9
2. Close the welcome page by
clicking a cross on the tab to
reveal the actual working
environment.
Figure 10
Figure 25
Download Code
Figure 28
26. Add and following flag to the
link options in all projects.
Download Code
Figure 29
Figure 34
32. You will see something like the
following in the console window
Download Code
33. If the program code runs
correctly, the on-board test LED
(usually red) should now start
blinking around 1 blink / sec.
Congratulations!
Final result!
Download Code
Then it's marker.1 shows the first
run of the black line, 0 points to the
first run of the white line, and -42
indicates the array is complete. Int
both show the length and turn back
and forth between black and white
until -1 is found, which indicates
the end of the line. For example, if
there is:
Download Code
.64 black pixels will be drawn, then
32 white pixels, then 32 black
pixels.
Download Code
And then make one more pixel than
time via GLCD.SetDot ().
Download Code
And draw a bitmap via
GLCD.DrawBitmap ():
Download Code
Put it into BMP_Dump project (C
# Visual Studio 2008 solution). It's
not too powerful (no error
checking) but no work done, it has
forgotten all 3 formats in (raw bool
array, compressed RLE int array,
and paged channel int array) in case
anyone wants to experiment with
different formats are generated and
display different images in their
graphic LCD (copy and paste) the
array after it is generated).
Ski
Image 4
Graphical LCD sketch is a game
called Ski, which is a game that
leads to the 8-bit games published
on computers in 80s, such as
Compute !, A.N.A.L.O.G., and
Antic. it is very simple where one
tries to stay within the limits, that is
skiing that can be used and use the
potentiometer to control direction of
the player. I must point out that not a
game programmer, Ski, a very
smooth game, and just a proof of
concept, but it shows what potential
can be done. For this sketch, in
addition to the 128x64 LCD
connected to your Arduino you will
need a push button connected to
digital pin 2 and a 10K Ohm
potentiometer connected to the
analog pin 5.
Image 5
Image 6
Note: This image 6 is not very good
(due to poor camera quality). I
lighten the image a bit but some of
the cable is still a bit hard to see.
The ground cable coming out of the
project board will enter the
Arduino ground pin, and ground
wire from the potentiometer enters
project board board ground.
Because the angle of photo was
taken (and contrast), in the image it
looks like a ground wire from a
potentiometer also goes into
Arduino ground pin. If you enlarge
the image, cord is a bit clearer.
Image 7
This lesson is held in a circular
memory buffer (g_course) and the
current position is tracked by
g_nCircularBuferPosition. At the
end of every 16 movements, a new
tilt is calculated:
Image 8
(The source code for Skiing is too
long, so please read the zip project
file for the entire source code.)
Ski2
Large Image
It's time to start learning more
about Arduino we start.
Blinking
Download Code
On each of the common functions -
setup () and loop (). setup () is
called when Arduino activates /
resets and initializes, and loop () is
repeatedly called repeatedly. At this
point, if there is no problem and
connect correctly, you are ready to
upload your first sketch. Just click
the "Upload to I / O Board" button
(this compiles and then uploads the
sketch):
Picture 3
After the sketching peoses are
transferred, you will only see the
LED on the micrcontroller board
blinking and off. You can use LEDs
soldered to the Arduino board:
Picture 4
Can also connect the LED to the
ground pin and pin 13.
Download Code
Arduino and speed to transmit
serial data on. In your code you will
then add Serial.print () and
Serial.println () statements to be
sent back to the IDE. To view serial
data that is sent, just click on the
"Serial Monitor" button.
Picture 7
When serial is active, the output is
displayed in serial output panel.
Picture 8
Though simple but it works and it's
better than nothing.
Conclusion
Early Adruino lesson has finished
this article as a basis for further
reading, you should check out
Arduino home page, Arduino start
page, and some user-generated
projects on the Arduino user project
page.
Automation Solution Using
Arduino
Automation solution using Arduino
Motivation
Most of the automation is needed in
the production world, you may
always think how to develop a
manual machine can be made
completely automated (no external
interface).
What to need
Arduino controller (I use
Arduino mega 2560) - 15 $ on
eBay.
8-Channel Relay Module for
Arduino - $ 10 on eBay.
40 wire 2 $ on eBay.
Arduino SDK -
http://Arduino.cc/.
Brief Explanation of Hardware.
Relay Module.
Download Code
We need to assign logic "1" to the
pin so that all relays are off:
Download Code
Download Code
In the loop method, we read the full
line of the serial port and detect
whether it opens or closes
commands, for example:
Download Code
For each command, we detect the
status by detecting the first
character of the command (+ or -)
and the second character for the
specific relay number. then we call
"SetStatus" with parameters
extracted.
Download Code
Then SetStatus method has two
parameters:
Large Image
Download Code
Thanks …….