Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;; Super simple button sanity test ;;;;;;;;;;;;;;
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- .include "tn45def.inc"
- .cseg
- .org 0x00
- .equ BTTN = 3
- .equ SERIN = 1
- sbi DDRB,SERIN
- cbi DDRB,BTTN
- sbi PORTB,SERIN
- Main:
- sbic PINB,BTTN ; Jump to main if button is not pushed
- rjmp Main
- cbi PORTB,SERIN ; Turn on LED
- sbis PINB,BTTN ; Turn off LED if button is not pushed
- sbi PORTB,SERIN
- rjmp Main ; Go to beginning of loop
- .exit
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Add Comment
Please, Sign In to add comment