Вопрос

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