Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .equ LED1 = 5
- .equ LED2 = 6
- .equ BUT1 = 2
- .equ BUT2 = 3
- .equ BUT3 = 4
- init:
- ldi R16, 1<<LED1 | 1<<LED2 ;LED1 LED2 as output / BUT1 input
- out DDRD, R16
- ldi R16, 1<<BUT1 | 1<<BUT2 | 1<<BUT3 ;activate Pullups for buttons
- out PORTD, R16
- loop:
- /* cbi PORTD, LED1
- sbis PIND, BUT1
- sbi PORTD, LED1
- rjmp loop*/
- /* cbi PORTD, LED1 ;clear bit
- cbi PORTD, LED2
- sbis PIND, BUT1 ;skip if bit set
- sbi PORTD, LED1 ;set bit
- sbis PIND, BUT2
- sbi PORTD, LED2
- rjmp loop*/
- /* sbis PIND, BUT1
- sbi PIND, LED1 ;man kann PORTX toggeln indem man eine 1 an die entsprechende stelle im register schreibt
- rjmp loop*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement