Comple error - worked on earlier versions

I'm getting this compiler error on the latest version of Arduino (version 2.3.4)
The last time I worked on this code was about a year ago (not sure what version) and it compiled OK with no errors or warnings. I'm also don't understand " PORTBemulation" on the last few lines.

Anyone have an idea what's going on. Has some feature been depreciated?

C:\Users\pangl\OneDrive\Documents\Arduino\FIlterControl_copy_MovingAverage_Rev2\FIlterControl_copy_MovingAverage_Rev2.ino: In function 'void AlarmLedOn()':
C:\Users\pangl\OneDrive\Documents\Arduino\FIlterControl_copy_MovingAverage_Rev2\FIlterControl_copy_MovingAverage_Rev2.ino:75:18: error: no match for 'operator&' (operand types are 'PORTBemulation' and 'int')
   75 |    PORTB = PORTB & 0b11111110;
      |            ~~~~~ ^ ~~~~~~~~~~
      |            |       |
      |            |       int
      |            PORTBemulation
C:\Users\pangl\OneDrive\Documents\Arduino\FIlterControl_copy_MovingAverage_Rev2\FIlterControl_copy_MovingAverage_Rev2.ino: In function 'void AlarmLedOff()':
C:\Users\pangl\OneDrive\Documents\Arduino\FIlterControl_copy_MovingAverage_Rev2\FIlterControl_copy_MovingAverage_Rev2.ino:81:18: error: no match for 'operator|' (operand types are 'PORTBemulation' and 'int')
   81 |    PORTB = PORTB | 0b00000001;
      |            ~~~~~ ^ ~~~~~~~~~~
      |            |       |
      |            |       int
      |            PORTBemulation

exit status 1

Compilation error: no match for 'operator&' (operand types are 'PORTBemulation' and 'int')

The issues seems to come from the fact that PORTB as a formal type of PORTBemulation and so when you try to use the operator & or | are not implemented

you would need to cast the type for the operator.

are you using a Teensy ? May be updating the boards would help.

I didn't include my source code because it was clear to me problem was not my source code since it worked on an earlier version.

J-M-L was right. I had forgotten that in the interim I had briefly worked with a teensy and that was what the board select was.

Hi, @gooberpat

What model Arduino controller are you using?

Tom.. :smiley: :+1: :coffee: :australia:

Glad if my answer helped - have fun.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.