Description
checkReceive()
– returns the number of message in the receive buffer.
Syntax
if( MCAN0.checkReceive() )
Parameters
none
Returns
uint8_t:
>1 – There are message(s) in the receive buffer
0 – Receive buffer is empty
Example Code
The following example sends messages on CAN bus MCAN0.
void setup()
{
while(!Serial);
Serial.println("Simple example receiving CAN messages");
}
void loop()
{
if( MCAN0.checkReceive() )
{
CANMessage t_canMesgToRecv;
if(MCAN0.readMsgBuf( t_canMesgToRecv ) == CAN_OK)
Serial.println(t_canMesgToRecv.toString());
}
}
Notes and Warnings
Examples can be found in the Arduino IDE menu:
File -> Examples -> DICE -> CAN Bus ->
See also
Find more details about the ‘bootloader settings’ and the CAN bus of dice devices
readMsgBuf
sendMsgBuf
defines
CAN operation background
users manual
BOOTLOADER SETTINGS – Library