Question

Using atmel studio to write some beginner C for an atmega64 micro controller. To start off I wanted to read values from PINA, one's complement the values, write them out on PORTC.

Started off with

#include <avr/io.h>
int main(void)
{

DDRA = 0x00; //set PORTA to inputs
DDRC = 0xFF; //set PORTC to outputs
while(1)
{
    ~PINA; // one's  values of PORT A




}
return 0;
}

Not so sure how to write the value out to PORTC,

Can anyone guide me where to go from here?

Cheers james

Était-ce utile?

La solution

Assignment operator (just like you would do with any other port):

PORTC = ~PINA;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top