Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdint.h>
- #include <stdbool.h>
- #include <avr/io.h>
- #include <avr/interrupt.h>
- #include <util/delay.h>
- int main (void)
- {
- DDRA &= ~_BV(PA0); /* PA0=input. */
- DDRC |= _BV(PC5); /* PC5=output. */
- if (PINA & _BV(PA0)) /* read PA0 */
- {
- PORTC |= _BV(PC5); /* write PC5=1 */
- }
- else
- {
- PORTC &= ~_BV(PC5); /* write PC5=0 */
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement