Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. /*
  2.  * Blink.cpp
  3.  *
  4.  * Created: 2020/02/16 16:03:50
  5.  * Author : mumou
  6.  */
  7.  
  8. #include <avr/io.h>
  9. #include <util/delay.h>
  10.  
  11. #define LED_bp 2 // PE2
  12. #define LED_bm (1<<LED_bp)
  13.  
  14. int main(void)
  15. {
  16.     PORTE.DIRSET = LED_bm;
  17.     PORTE.OUTCLR = LED_bm;
  18.  
  19.     /* Replace with your application code */
  20.     while (1)
  21.     {
  22.         _delay_ms(1000);
  23.         if(PORTE.OUT & LED_bm){
  24.             PORTE.OUTCLR = LED_bm;  
  25.         }else{
  26.             PORTE.OUTSET = LED_bm;
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement