Hi,
I am trying to write an interrupt that uses bitSet(), bitClear(), bitRead(), etc., to manipulate the ports for speed, rather than digitalRead() and digitalWrite(). Why do I need that speed? I don't, actually. But I want to do it because I want to learn more about the AVR, I want to get my chops up, and because it's there (tm).
But bitSet() has two arguments: The PORT, and the pin in the PORT. However, I would like my library that includes this interrupt to take the Arduino pin as its argument; I don't want the programmer to have to figure the PORT and pin.
Can anyone explain to me why this works:
uint8_t sPort = digitalPinToPort(13);
bitSet(sPort, 5);
But this does not?
bitSet(digitalPinToPort(13), 5);
...This one says, "error: lvalue required as left operand of assignment".
Thanks.