Advertisement
grist

Arduino LED Blinker

Feb 6th, 2012
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. /*
  2.  
  3. Playing with generating and trapping interrupts using the Arduino and
  4. an ATtiny2313.
  5.  
  6. Simple LED blinker, pin 9 will actually be connected to the ATtiny.
  7.  
  8. */
  9.  
  10. byte led_pin = 8;
  11. byte int_pin = 9;
  12.  
  13. void setup() {
  14.   // put your setup code here, to run once:
  15.   pinMode(led_pin, OUTPUT);
  16.   pinMode(int_pin, OUTPUT);
  17.  
  18. }
  19.  
  20. void loop() {
  21.   // put your main code here, to run repeatedly:
  22.   digitalWrite(led_pin, HIGH);
  23.   digitalWrite(int_pin, HIGH);
  24.   delay(1000);
  25.   digitalWrite(led_pin, LOW);
  26.   digitalWrite(int_pin, LOW);
  27.   delay(1000);
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement