EasyManuals Logo

Arduino NG User Manual

Arduino NG
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 #65 background imageLoading...
Page #65 background image
Figure 11A first working version of our binary die
all sockets in this row will work as ground pins, too. Then you can connect
this rows sockets to the LEDs using short wires.
Everything else in this circuit should look familiar, because we only had to
clone the basic LED circuit from the previous section three times. Note that
we have connected the three LEDs to pins 10, 11, and 12. The only thing
missing is some software:
BinaryDice/BinaryDice/BinaryDice.ino
const unsigned int LED_BIT0 = 12;
Line 1
const unsigned int LED_BIT1 = 11;
-
const unsigned int LED_BIT2 = 10;
-
-
void setup() {
5
pinMode(LED_BIT0, OUTPUT);
-
pinMode(LED_BIT1, OUTPUT);
-
pinMode(LED_BIT2, OUTPUT);
-
-
randomSeed(analogRead(A0));
10
long result = random(1, 7);
-
output_result(result);
-
}
-
Chapter 3. Building Binary Dice 46
report erratum discuss
www.it-ebooks.info

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Arduino NG Specifications

General IconGeneral
BrandArduino
ModelNG
CategoryMotherboard
LanguageEnglish

Related product manuals