0% found this document useful (0 votes)
22 views1 page

AVR Code for Input/Output Control

This C code configures ports on an AVR microcontroller. It sets port A pins as outputs except pin 0 which is set as an input. Port C pin 0 is also set as an output. The program continuously checks the state of port A pin 0, and if high it sets port C pin 0 high, if low it sets port C pin 0 low, toggling it.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views1 page

AVR Code for Input/Output Control

This C code configures ports on an AVR microcontroller. It sets port A pins as outputs except pin 0 which is set as an input. Port C pin 0 is also set as an output. The program continuously checks the state of port A pin 0, and if high it sets port C pin 0 high, if low it sets port C pin 0 low, toggling it.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#include<avr/io.

h>

#include<util/delay.h>

void main()

DDRA = 0b11111110;

DDRC = 0b00000001;

while(1)

if (PINA == 0b00000001)

PORTC =0X01;

if (PINA==0b00000000)

{PORTC=0X00;

}}

You might also like