Pages: [1]   Go Down
Author Topic: SOLVED Please help: Pins are not functioning!  (Read 684 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I've been following some learning tutorials from a book and I've been stuck on this part for days.

I don't know why, but my pins from 1-11 don't work. As you can see from the picture below, it fails to light up the LED. I checked all the wires, resistors and LEDs with the working pins (12, and 0) and they function perfectly fine.  

All these devices are brand new, so I doubt it is the arduino uno or the breadboard's fault.

Any help would be SOOO wonderful! This is giving me quite the headache  smiley-cry

« Last Edit: March 17, 2012, 07:25:36 pm by blanclait » Logged

Tucson, AZ
Online Online
Sr. Member
****
Karma: 8
Posts: 314
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you please post the code that you are using?
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 25
Posts: 1310
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Check things first -
Make sure all outputs are HIGH.
swap a working led/resistor to the faulty led position, move the layout to other rows on the breadboard (Been caught by this myself on more than 1 occasion)
Make a 'tester' by using 1 resistor(220Ohm to 440Ohm) and 1 led, and wire.

connect them       ----------resistor-------(+ LED -)----------wire
connect the wire to GND on the arduino
pop the other end into the output you want to test
digitalWrite(pin,HIGH);
if it lights - the output is working
try each one in turn
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And make sure you are not using Digital 0 and 1. They are "occupied".

And make a test code. A simple multi blink, like :

Code:
// check all digital pins except pin 1 and 0
// Those a reserved pins for Com link

const byte the_pins[12] = {13,12,11,10,9,8,7,6,5,4,3,2};

void setup()
{               
  for (int i=0;i<12;i++)
  {
    pinMode(the_pins, OUTPUT);
    digitalWrite(the_pins, LOW);
  }   
}

void loop()
{
  for (int i=0;i<12;i++)
  {
    digitalWrite(the_pins, HIGH);
    delay(1000);
    digitalWrite(the_pins, LOW);
  } 
}
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 300
Posts: 26219
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But unlike that example, make sure you put a delay after turning the pin LOW in the for loop, otherwise you might think your LED isn't turning off
« Last Edit: March 17, 2012, 05:42:52 pm by AWOL » Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Canada
Offline Offline
God Member
*****
Karma: 7
Posts: 602
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you can just move one of those yellow wires from say, pin 11 of the Arduino, to pin 12, make the appropriate change to the program and it works, then it must be the Uno or the Atmega328 on it.
Logged

Facts just don't care if you ignore them.

WV
Offline Offline
Full Member
***
Karma: 0
Posts: 160
Arduino, Helps With the ADD
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes check your connections, it almost looks like from your pict that the breadboad has the connections in the incorrect place.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Quote
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.
Logged

WV
Offline Offline
Full Member
***
Karma: 0
Posts: 160
Arduino, Helps With the ADD
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

might try something goofy, just connect say pin 10 to resistor to led to ground ,, without using the breadboard or even use pin 13 tempararly just to check the setup smiley see what results .
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17293
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why the const in the statement void output_result(const long result) {

That doesn't look right. And calling two different variable the same name 'result' is misleading.

Lefty

Logged

Scotland
Offline Offline
Edison Member
*
Karma: 25
Posts: 1310
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If the wires are in the correct place, the resistors are the correct values, the LEDs are in the correct orientation, then it should work - You have tested the outputs - they work, you have tested the resistors and LEDs individually - they work. The only common factor left is human error! - When I come up against similar situations - I take out all the wires, resistors and LEDs. and start again, but one at a time - pin 10 -> resistor -> led Anode : led Cathode - GND . . . . . . . then do the same for 11 then 12  Hopefully that will get to the bottom of it.
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why the const in the statement void output_result(const long result) {

That doesn't look right. And calling two different variable the same name 'result' is misleading.

Lefty



My gosh. Yes there was indeed a problem with the script name. Thank you!!

And Thank you for everyone who posted. All of you have been a great help in either solving the problem or learning a trick or two about arduino. Thank you all  smiley-mr-green
Logged

Pages: [1]   Go Up
Jump to: