C125 - Button sends CAN Message

D153, D175, C125, C127, C185 and C187 forum

C125 - Button sends CAN Message

Postby hamer on Wed Jul 19, 2023 4:53 am

What's the best way to setup a button to send a CAN message? Are the digital inputs the only way to get the input to the dash? Looking at using a handlebar mounted switchgear with multiple buttons, would love to be able to program them all.

Thank you.
hamer
 
Posts: 35
Joined: Thu May 25, 2023 4:51 am
Location: Scotts Valley, CA

Re: C125 - Button sends CAN Message

Postby David Ferguson on Wed Jul 19, 2023 11:35 am

Best is relative.

You can connect buttons to Digital, Speed, and/or AT inputs easily (just wire them to the inputs and the 0V pin) and create CAN messages to be transmitted. If you don't have the I/O available to do this, then perhaps you could use something like the ECU Master CAN switchboard (https://ecumasterusa.com/products/can-s ... 8139170877) to handle buttons and knobs, it's small enough to be build into the housing with the buttons & knobs.

I often use two buttons, to control a multi-value trim (like backlight brightness, or traction aim), using C125 Dash Manager->Calculations->Up/Down Counters...
David Ferguson
Veracity Racing Data
David Ferguson
Pro User
 
Posts: 1410
Joined: Fri Nov 07, 2008 2:45 am
Location: Paso Robles, California

Re: C125 - Button sends CAN Message

Postby hamer on Sat Aug 05, 2023 4:45 am

Thanks Dave, I may order one of those boards to play around with, seems useful.

Circling back to this, trying to figure out the logic and how to set it up.

Button 1: Cycle Channel A from 1 to 2 then reset to 1 (Figured this out)

Button 2: Set Channel A to 3 and 3 only, no counting

So essentially I'm asking two different buttons to set values in different ways on the same channel. Dash Manager doesn't seem to like doing this? The reason I need the same channel modified is because I will be transmitting that value over CAN. And I don't think there is a good way to send the same CAN ID via different channels?

To summarize, Button 1 cycles 1-2-1, Button 2 sets value fixed at 3. If Value is set to 3 and button 1 is pressed, it goes back to 1-2-1.

Any ideas?
hamer
 
Posts: 35
Joined: Thu May 25, 2023 4:51 am
Location: Scotts Valley, CA

Re: C125 - Button sends CAN Message

Postby David Ferguson on Mon Aug 07, 2023 4:06 am

Here is a C125 config that does what you requested.

- Configure Controller Button 1 & 2 from digital inputs.
- Counter 1 -- counts 1-2 from Controller Button 1
- User Condition "Button 2 Active" activates when Button 2 is true, and Deactivates when Button 1 is true.
- Table to generate "Channel A", uses Counter 1 and Button 2 Active to implement your desired logic
- Channel A transmitted over CAN.

Forum 2-Button 1-CAN output.c125v64
Sample C125 Config
(1.34 MiB) Downloaded 607 times
David Ferguson
Veracity Racing Data
David Ferguson
Pro User
 
Posts: 1410
Joined: Fri Nov 07, 2008 2:45 am
Location: Paso Robles, California

Re: C125 - Button sends CAN Message

Postby hamer on Tue Aug 08, 2023 2:51 am

Hi Dave,

Thanks for the solution, great way to do it. I ended up implementing it a slightly different way, but it seems your solution may be slightly simpler.

My solution (for others' reference):
1) Counter from 1-2 that rolls at limits. Activated by Button 1
2) Up Only Counter from 2-3 that does not roll at limits, has a reset value of 2. Up: Button 2, Reset: Button 1
3) 3D table with the output of both channels calculating the output channel that is transmitted over CAN.
hamer
 
Posts: 35
Joined: Thu May 25, 2023 4:51 am
Location: Scotts Valley, CA


Return to Colour displays

Who is online

Users browsing this forum: No registered users and 16 guests