EasyManuals Logo

Arduino uno User Manual

Arduino uno
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #64 background imageLoading...
Page #64 background image
BinaryDice/Blink/Blink.ino
const unsigned int LED_PIN = 12;
const unsigned int PAUSE = 500;
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
digitalWrite(LED_PIN, HIGH);
delay(PAUSE);
digitalWrite(LED_PIN, LOW);
delay(PAUSE);
}
Weve built a strong foundation for our project, and in the next section well
build upon it.
First Version of a Binary Die
Youre certainly familiar with a regular die displaying results in a range from
one to six. To emulate such a die exactly with an electronic device, youd need
seven LEDs and some fairly complicated business logic. Well take a shortcut
and display the result of a die roll in binary.
For a binary die, we need only three LEDs to represent the current result. We
turn the result into a binary number, and for every bit that is set, we light
up a corresponding LED. The following diagram shows how the die results
are mapped to LEDs. (A black triangle stands for a shining LED.)
We already know how to control a single LED on a breadboard. Controlling
three LEDs is similar and requires only more wires, LEDs, 1k resistors, and
pins. Figure 11, A first working version of our binary die, on page 46 shows
the first working version of a binary die.
The most important difference is the common ground. When you need ground
for a single LED, you can connect it to the LED directly. But we need ground
for three LEDs now, so well use the breadboards rows for the first time.
Connect the row marked with a hyphen (-) to the Arduinos ground pin, and
report erratum discuss
First Version of a Binary Die 45
www.it-ebooks.info

Table of Contents

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino uno and is the answer not in the manual?

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals