Advertisement
elektronek

Marek Burlak Novotny - Blink all pins mega 2560

Feb 26th, 2023
813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Arduino 0.43 KB | Software | 0 0
  1. /* Test vsech pinu mega2560 blink */
  2. #define F_CPU 16000000ul
  3. #include <avr/io.h>
  4. #include <util/delay.h>
  5.  
  6. int main(void)
  7. {
  8.   DDRA=0xff; DDRB=0xff; DDRC=0xff; DDRD=0xff; DDRE=0xff;
  9.   DDRF=0xff; DDRG=0xff; DDRH=0xff; DDRJ=0xff; DDRK=0xff;
  10.   DDRL=0xff;
  11.   while (1)
  12.   {
  13.     PINA=0xff;PINB=0xff;PINC=0xff;PIND=0xff;PINE=0xff;
  14.     PINF=0xff;PING=0xff;PINH=0xff;PINJ=0xff;PINK=0xff;
  15.     PINL=0xff;
  16.     _delay_ms(500);
  17.   }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement