Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * sk.c
- *
- * Created on: Feb 17, 2019
- * Author: students
- */
- #include <avr/io.h>
- #include <avr/delay.h>
- #define F_CPU 16000000UL
- int main(void)
- {
- DDRD &= ~_BV(DDD5); //Set as input
- DDRB |= _BV(DDB5); // set as output
- PORTB= 0x00;
- while(1)
- {
- if(bit_is_clear(PIND,PIND5))
- {
- PORTB|= _BV(PORTB5);
- }
- else
- {
- PORTB &= ~_BV(PORTB5);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement