Skip to content

Instantly share code, notes, and snippets.

@brentpicasso
Created November 20, 2019 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brentpicasso/dc8f9930675b766b8b6ff299c751f58e to your computer and use it in GitHub Desktop.
Save brentpicasso/dc8f9930675b766b8b6ff299c751f58e to your computer and use it in GitHub Desktop.
val = 0
-- transmit on CAN1 and receive on CAN2
function onTick()
--transmit value on CAN1
txCAN(0, 1234, 0, {val})
--receive on CAN2
id, e, data = rxCAN(1)
if id ~= nil then
println(id ..' : '.. data[1])
else
println('no data')
end
val= val + 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment