I am receiving serial communication through the USB port to my Arduino (ATmega2560) by using the RX0 pin. In the receive function I want to compare the register that receives information UDR0 with unsigned char pckaffe[4]. The data that is being sent through the USB port onto the Arduino comes from a pc and if everything works correctly, it should be sending unsigned char arrays, which is why I am comparing UDR0 to unsigned char pckaffe.
However at the if statement, the compiler is saying Error ISO C++ forbids comparison between pointer and integer [-fpermissive]
Why is that?
unsigned char pckaffe[4] = { 0x0C, 0x0A, 0x0F, 0x0E };
void USART_Receive(){
while(!(UCSR0A & (1<<RXC0)) );
if(UDR0 == pckaffe){
PORTB ^= (1 << PB1);
}
}
Serial.read();) - datafiddler