Guest User

Testprogramm für Taster

a guest
Oct 11th, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. /*
  2.  * simpletest.cpp
  3.  *
  4.  * Created: 11.10.2015 12:30:52
  5.  *  Author: Kim-Yannick
  6.  */
  7.  
  8. #define F_CPU 10000000UL
  9.  
  10. #include <avr/io.h>
  11. #include <util/delay.h>
  12.  
  13. char codes[] = {0b01111110, 0b01001000, 0b00111101, 0b01101101, 0b01001011, 0b01100111, 0b01110111};
  14.  
  15. int main(void)
  16. {
  17.     DDRD = 0xFF;
  18.     DDRC = 0x00;
  19.    
  20.     PORTC = 1;
  21.    
  22.     while (1) {            
  23.         PORTD = codes[PINC&1];
  24.         _delay_ms(10);
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment