Hi,
I have an ATtiny84 with Core from Spence Konde. The documentation says:
To refer to pins by port and bit, use PIN_Pxn (ex, PIN_PB2); these are #defined to the Arduino pin number for the pin in question, and can be used wherever digital pin numbers can be used.
Within an interrupt routine I use it:
ISR(TIM1_COMPB_vect) {
PIN_PB2=0; // Triac feuern <<<< this is line 55
}
The compiler reports an error:
H:\Arduino\examples\MotorRegler\MotorRegler.ino: In function 'void __vector_7()':
MotorRegler:55:11: error: lvalue required as left operand of assignment
PIN_PB2=0; // Triac feuern
^
I don't understand this " lvalue required as left operand of assignment". What is wrong with "0" ?
I also tried PORT_PB2 instead of PIN_PB2 because somewhere I read to use PORT for output and PIN for input from ports. But the compiler doesn't like it too: " PORT_PB2 not defined".
You can't use this to set Pin 2 LOW: 2 = LOW;
You have to use: digitalWrite(2, LOW);
So you can't use this: PIN_PB2 = LOW;
You have to use this: digitalWrite(PIN_PB2, LOW);