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

有帮助吗?

解决方案

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

PORTC = ~PINA;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top