B4R Question Send 8 bytes via CAN bus

petr4ppc

Well-Known Member
Licensed User
Longtime User
Dear friends, please,

please I need to send 8 bytes via CAN BUS (ESP32):

B4X:
        Dim buf(8) As Byte
        buf(0) = "0x94";
        buf(1) = "0x00";
        buf(2) = "0x00";
        buf(3) = "0x00";
        buf(4) = "0x19";
        buf(5) = "0x20";
        buf(6) = "0x21";
        buf(7) = "0x22";
        can.SendMessage(1, buf)

Is this right way please?

Best regards
p4ppc
 

RJB

Active Member
Licensed User
Longtime User
I'm afraid I don't know about CAN BUS but in your code you don't need the quotes or semi colons.
I think something like:
B4X:
dim buf() as Byte = array as byte(0x94, 0x00, 0x00, 0x00, 0x19, 0x20, 0x21, 0x22)
can.SendMessage(1, buf)
would probably be better/ easier
 
Upvote 1
Top