Arduino Uno Quick Start Manual page 65

Hide thumbs Also See for Arduino Uno:
Table of Contents

Advertisement

Figure 11 A first working version of our binary die
all sockets in this row will work as ground pins, too. Then you can connect
this row s 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
Line 1
const unsigned int
-
const unsigned int
-
-
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);
-
}
-
LED_BIT0 = 12;
LED_BIT1 = 11;
LED_BIT2 = 10;
www.it-ebooks.info
Chapter 3. Building Binary Dice
46
report erratum
discuss

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

Table of Contents