All pastes #1497845 Raw Edit

Arduino Clock

public cpp v1 · immutable
#1497845 ·published 2009-07-17 05:02 UTC
rendered paste body
int inPin = 3;void setup(){  pinMode(inPin,INPUT);  Serial.begin(57600);  //delay(1500);  while(Serial.available() == false){  }  attachInterrupt(1, blink, FALLING);  }int count=0;int hours = 14;int minutes = 10;int seconds = 0;void ClockTick(){  seconds++;  if(seconds == 60){    seconds = 0;    minutes++;  }  if(minutes == 60){    minutes = 0;    hours++;  }  if(hours == 24){    hours=0;  }  Serial.print("H: " ); Serial.print(hours); Serial.print(" M: "); Serial.print(minutes); Serial.print(" S: "); Serial.println(seconds);}void loop(){}void blink(){  if(count == 50)  {    count = 0;    ClockTick();  }  count++;}