Page 1 of 1

CAN message gain

Posted: Sun Jul 11, 2021 10:41 am
by Peter
HI Forum. Is it possible to set a divider in the gain area when mapping a CAN message ? I am transmitting 'Turns' to use for odometer but would like to divide the Turns value by 422 so Turns increments by 1 every 1/10th mile. Fingers crossed its possible :-) Thanks. Peter

Re: CAN message gain

Posted: Tue Aug 03, 2021 8:23 pm
by EV_Builder
Cant the receiving party do that? makes perhaps more sense because they know the ratio?
If i understand correctly what you want you also would need something like a counter so when you have sended the message you reset to zero and next time you send the delta, not?

Re: CAN message gain

Posted: Tue Aug 03, 2021 8:55 pm
by Mojave
Peter wrote: Sun Jul 11, 2021 10:41 am HI Forum. Is it possible to set a divider in the gain area when mapping a CAN message ? I am transmitting 'Turns' to use for odometer but would like to divide the Turns value by 422 so Turns increments by 1 every 1/10th mile. Fingers crossed its possible :-) Thanks. Peter
Couldn't you use (1/422) as the gain? i.e. use a gain of 0.0023697 (that's 1/422) as the gain?

Re: CAN message gain

Posted: Sat Aug 07, 2021 10:10 am
by Peter
Thanks for the ideas. I can indeed divide the CAN by 422 in software but was trying to reduce the loop time on my Arduino.