Advertisement
dzieciol

Mikrokontrolery cw2 zad1

Oct 20th, 2017
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include<avr/io.h>
  2.  
  3. int main(void){
  4.     DDRA = 0xFF;
  5.     DDRB = 0x0F;
  6.     unsigned char napis[4];
  7.     napis[0] = 0b00000110;//E
  8.     napis[1] = 0b00101111;//r
  9.     napis[2] = 0b00100011;//o
  10.     napis[3] = napis[1]; // r
  11.     PORTA = napis[2];
  12.     PORTB = 0b00001011;
  13.  
  14. for(;;){
  15.     for (unsigned char i = 0; i<4 ; i++){
  16.         PORTB = ~(_BV(3-i));
  17.         PORTA = napis[i];
  18.         for(unsigned long i=0; i<=100;i++){
  19.                 __asm__ ( "nop;");
  20.             }
  21.     }
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement