i use Arduino Nano with rp4 , simple Arduino code to activate ABS warning light , can any one write the correct xml frame that suitable for this code ,----- note : dont recomend example files cause it not working ![:slight_smile: :slight_smile:](https://forum.realdash.net/images/emoji/twitter/slight_smile.png?v=12)
unsigned int ABS = 1; // value must be 1 to activate abs warning light
void SendCANFramesToSerial()
{
byte buf[8];
memcpy(buf, &ABS, 2);
// write first CAN frame to serial
SendCANFrameToSerial(1300, buf);
What your example code is doing is sending a CAN frame with id 1300 (0x514 hex). The value of ABS is set to first two bytes of the frame and remaining 6 bytes are left uninitialized (which is not nice).
To read this value in RealDash, this XML snippet should work:
<?xml version="1.0" encoding="utf-8"?>
<RealDashCAN version="2">
<frames>
<frame canId="0x514">
<value name="My custom ABS light" offset="0" length="2" units="bit"></value>
</frame>
</frames>
</RealDashCAN>
When this XML is loaded into RealDash, it creates new custom input called “My custom ABS light” and reads first two bytes from the frame. The units=“bit” indicates that value can be either 0 or 1, and therefore only the LSB bit from 16 bits is processed while reading the value.
Hope this will get you started.