Lots of new files!!
[arduino-intervalometer.git] / timer / timer.pde
blob588473ccbc3f582fb05ba8e77b27a95aac470f83
1 int pin = 13;
2 volatile int delayus = 0; // microseconds
4 void setup()
6   pinMode(2, INPUT);
7   pinMode(pin, OUTPUT);
8   
9   digitalWrite(2, HIGH);
10   digitalWrite(pin, LOW);
11   
12   attachInterrupt(0, blink, FALLING);
15 void loop()
17   //digitalWrite(pin, state);
18   
21 void blink()
23   noInterrupts();
25   delayMicroseconds(delayus);
26   
27   PORTB = 1 << 5;
28   delayMicroseconds(1000);
29   PORTB = 0;
30   
31   delayMicroseconds(10000);
32   delayMicroseconds(10000);
33   delayMicroseconds(10000);
34   delayMicroseconds(10000);
35   
36   interrupts();