This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:projects:can_ping_pong [2010/03/14 14:48] – created mikk.leini | en:projects:can_ping_pong [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== CAN ping-pong ===== | ===== CAN ping-pong ===== | ||
- | // | + | // |
+ | |||
+ | [{{ : | ||
+ | |||
+ | The following program demonstrates the usage of CAN messaging on ARM-CAN controllers. Both controller have the same code. Whenever the button is pressed, a CAN message carrying a ping number is sent. If the message is received by the other node, it lights up it's red LED with intensity relative to the ping number and waits for 200 ms. After that it turns the LED off and sends the similar packet with decreased ping number to the controller which sent it out at first place. Messages are exchanged until the ping count reaches zero. | ||
+ | |||
+ | ~~CL~~ | ||
===== can_ping_pong.c ===== | ===== can_ping_pong.c ===== |