Confusing I/O Pin Nomenclature and Behavior

Discussion in 'UDOO 101' started by roncordell, Oct 29, 2013.

  1. roncordell

    roncordell New Member

    Joined:
    Oct 29, 2013
    Messages:
    2
    Likes Received:
    0
    Hi all,

    I'm just starting to "play" with my new UDOO board. I went through the tutorial http://www.udoo.org/ProjectsAndTutorials/getting-started-with-arduino-ide-on-udoo/?portfolioID=1394 that goes through programming the Ardiuno from Ubuntu running on the UDOO. Being an Arduino noob I ran into a few confusing things and was hoping people could help me out.

    1. The tutorial describes connecting an LED to GPIO 13 and GND. Looking through all the pinout tables and diagrams I could not find anything that was labelled as GPIO13. What's really confusing is that the physical pins have multiple definitions, but that's another forum posting. Anyway, I managed to find a photo of the Arduino DUE board and saw that one of the headers had I/O pins silkscreened 1-13, then GND, PWR and a couple of serial pins. I guessed that the I/O pin labelled "13" was GPIO 13 as called out in the tutorial and that seemed to be the case.

    2. The tutorial blinks an LED on and off at 1 second intervals. Here is the code:
    Code:
    int led = 13;
    void setup() {
    pinMode(led, OUTPUT);}
    void loop() {
    digitalWrite(led, HIGH);   
    delay(1000);    
    digitalWrite(led, LOW);  
    delay(1000);      
    }
    The odd thing is that the LED isn't responding the way the code is written. Instead the LED is blinking 3 times quickly, then is off for 1 seconds, then the cycle repeats.

    So I'm not sure that I'm using the correct output pins because this code is pretty simple and seems like it should work.

    Any ideas as to what I might be doing wrong?

    Thanks!
     
  2. jimmnh

    jimmnh New Member

    Joined:
    Aug 16, 2013
    Messages:
    82
    Likes Received:
    0
    Do you have the positive leg (anode) of the LED connected to a resistor before it is connected to I/O 13?
     
  3. DracoLlasa

    DracoLlasa UDOOer

    Joined:
    Oct 15, 2013
    Messages:
    419
    Likes Received:
    3
    if you have the QUAD, the main Heatsink covers up most of the pin labels on the top, but if you flip the board over you will see the pin labels on the back. From there you will find pin 13 next to the GND pin and then test your sketch but putting the long ping of the LED into the ping 13 hold and the short end into the GND point... Not technically i think you are supposed to have a resistor in there to protect the LED, but you can put it in there quick to test it out.
     
  4. andcmp

    andcmp New Member

    Joined:
    May 8, 2013
    Messages:
    161
    Likes Received:
    0

Share This Page