c programming help

Discussion in 'Programmer's Corner' started by varunme, Feb 22, 2012.

  1. varunme

    Thread Starter Member

    Sep 29, 2011
    59
    0
    i am interfacing RTC and led
    i want to turn a motor(just turn on) when i press a switch how can i in coperate that too inside my code in C ?





    Code ( (Unknown Language)):
    1.  
    2.  
    3. void main() {
    4.  
    5.  
    6.     while (1){
    7.        
    8.       do {
    9.  
    10.  
    11.     clock continously shows time in LCD
    12.  
    13.          
    14.       } while (!(Button(&PORTC, 0, 1, 1)));
    15.  
    16.  
    17.  
    18.  
    19.  
    20.  
    21.       if ((Button(&PORTC, 0, 1, 1)))
    22.       {
    23.       delay_ms(20);
    24.             Edit_Dt();  // Here it edits time
    25.       }
    26.    }
    27. }
    28.  
    29.  
     
  2. varunme

    Thread Starter Member

    Sep 29, 2011
    59
    0
    yes,
    just adding an if,
    some problems with simulator kept me out of sucess
     
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    You are going to have to post a lot more details than this to get help. What compiler? What chip? What RTC? And the big one, where is the rest of your code???
     
Loading...