RealDash_CAN_2way

Has anyone been able to use RealDash_CAN_2way?

It simply does not work on android or windows.

On my tests with Arduino Nano the example has worked just fine. Changes to the example may be required if running another type of Arduino.

Could you describe in more detail what is the problem with this example?

what do you mean by “RealDash_CAN_2way”?

Only option I see the “RealDash CAN” is this what you are talking about, if so I use it and it works find, although it could use some improvement.

RealDash_CAN_2way is an example in our Github:

https://github.com/janimm/RealDash-extras

I tested the code on Arduino MEGA and Nano, by Bluethoot comunucation and USB Cable.

The inputs and outputs did not work, I had to remove the bars:
// # define READWRITE_PINS, to work the inputs.
Digital outputs didn’t work, sometimes they went wrong.

Describe in detail your problem. Now it is quite lengthy!
Attach the video on YouTube. It can be easier to understand …

look at the difference on the CAN monitor:

Realdash_CAN_2WAY:
Realdash_CAN_2WAY.PNG
Realdash_CAN:
Realdash_CAN.PNG

I don’t understand how the original code doesn’t work for me.

After several attempts, I managed to make the outputs work with the following changes:

uncomment: #define READWRITE_PINS

/

pinMode(i+1,OUTPUT); //Defines outputs
 digitalWrite(i + 1, (digitalPins & (1 << i)) ? HIGH : LOW);  //   | exchanged for &

Good catch. I’m sorry about this typo, it was fixed on my code a long time ago, but I forgot to push it to GitHub. Thanks for pointing that out, sorry for the trouble :neutral_face:

gents,

I am trying to send a frame from RD to can bus based on trigger. For example, I want to send the following frame:
ID 0180: AA BB CC DD

Now, I have to update my “Arduino ino” file to be able to send this frame using can.sendMsgBuf () function. is it correct?

void ProcessIncomingFrame(const byte* frame)
{
if (frame[0] != 0x44 ||
frame[1] != 0x33 ||
frame[2] != 0x22 ||
frame[3] != 0x11)
{

return;
}

unsigned long canFrameId = 0;
memcpy(&canFrameId, frame + 4, 4);

byte checkByte = 0;
for (int i=0; i<16; i++)
{
checkByte += frame_;
}

if (frame[16] == checkByte)
{

CAN.sendMsgBuf(canFrameId, 0, 8,frame + 8 );
delay(2000);
}_