my apologies. This is the code given in the book.
It uses pin 10,11 & 12.
it is suppose to be some kind of binary dice.
const unsigned int LED_BIT0 = 12;
const unsigned int LED_BIT1 = 11;
const unsigned int LED_BIT2 = 10;void setup() {
pinMode(LED_BIT0, OUTPUT);
pinMode(LED_BIT1, OUTPUT);
pinMode(LED_BIT2, OUTPUT);randomSeed(analogRead(A0));
long result = random(1,7);
output_result(result);
}void loop() {
}void output_result(const long result) {
digitalWrite(LED_BIT0, result & B001);
digitalWrite(LED_BIT0, result & B010);
digitalWrite(LED_BIT0, result & B100);
}
@spycatcher
I tried moving the rows and they have been tested separately. Though I can't be sure about breadboard and arduino uno, as far as the wires, led and resistors go, they all are working.
Probem is that the pin 1-10 isn't feeding anything to the led. Idk why.
@woody
connection is done like this
Pin 12 -> row 3, which has both sides of resistor, followed by positive of the LED.
row 4, has negative of the LED which is followed by short wire connecting to the negative of the breadboard.
At the end, the blue wire connects from negative of the breadboard to the Ground.