Project

General

Profile

Revision 215b2fa6

ID215b2fa66046d88ba8984bdbb1ebff2b0bea32b6
Parent 1085ef77
Child f5d1f56a

Added by Thomas Mullins over 11 years ago

Fixed timer error correction

View differences:

toolbox/led.c
46 46
  error += ERROR;
47 47
  if (error >= 1000) {
48 48
    error -= 1000;
49
    OCR0A = OCR+1;
49 50
  } else {
50
    ms++;
51
    if (ms == blink_period) {
52
      blink();
53
      if (blink_count == 0) {
54
        TCCR0B = 0;
55
      }
56
      ms = 0;
51
    OCR0A = OCR;
52
  }
53
  ms++;
54
  if (ms == blink_period) {
55
    blink();
56
    if (blink_count == 0) {
57
      TCCR0B = 0;
57 58
    }
59
    ms = 0;
58 60
  }
59 61
}
60 62

  

Also available in: Unified diff