c code for led blinking

Discussion in 'Embedded Systems and Microcontrollers' started by dilesh, Apr 5, 2012.

  1. dilesh

    Thread Starter New Member

    Mar 28, 2012
    2
    0
    hey frns i require c code for blinking of led...i hv atmega 644p on sanguino board
    pls specify the pin to wch i shud conect on microcontroller
     
  2. nerdegutta

    Moderator

    Dec 15, 2009
    2,517
    785
    Here's is what you should to:

    1. Write proper English
    2. Tell us what you have done so far

    Then we can see what we can do. :)
     
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,015
    What the heck is frns? Is that that new fangled text speak all of the youngsters are using these days?
     
  4. justtrying

    Active Member

    Mar 9, 2011
    329
    351
    friends?

    you have to learn how to write to pins.

    http://sanguino.cc/useit code is based on arduino, they have many samples
     
    Last edited: Apr 6, 2012
  5. be80be

    Senior Member

    Jul 5, 2008
    431
    57
    This is easy there are all kind of samples hardiest part is setting up the arduino software
    read it it tells what pins to use
    Code ( (Unknown Language)):
    1.  
    2.  /*
    3.   Blink
    4.   Turns on an LED on for one second, then off for one second, repeatedly.
    5.  
    6.   This example code is in the public domain.
    7.  */
    8.  
    9. void setup() {                
    10.   // initialize the digital pin as an output.
    11.   // Pin 13 has an LED connected on most Arduino boards:
    12.   pinMode(13, OUTPUT);    
    13. }
    14.  
    15. void loop() {
    16.   digitalWrite(13, HIGH);   // set the LED on
    17.   delay(1000);              // wait for a second
    18.   digitalWrite(13, LOW);    // set the LED off
    19.   delay(1000);              // wait for a second
    20. }
     
Loading...