temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Mon Sep 03, 2018 3:06 pm |
|
|
While I don't use CAN, the process is simple.
Start small, cut code and confirm you can read some of the CAN slave device registers. Once that works, simply read the register(s) that contain the speed. Those must be documented 'somewhere'.
Once that can be done, it's a simple chunk of code to compare what was read (actual speed) to your 'setpoint' of 30KMh. To turn on the LED , it's as easy as if(real_speed >= setpoint ) LED_ON();
Where LED_ON() is a function or macro to control the LED, real_speed is a variable containing the truck's speed, and setpoint is the digital equal to 30KMh.
You'll have to figure out what 30KMh is 'digitally', creat the LED macro, etc.
all easy and simple steps, just take one at a time, get it working, then build from that.
Jay |
|