I’ve been working on building a machine that will be used to test semi-trailer lights and air brake systems for use in the repair shop. I’ve written the code that will select and activate a bank of 8 relays to perform various functions via rotary encoder with pushbutton integrated. This allows 1 knob to perform all functions and will simplify the control panel.
My next task is to display the status of each relay on a bank of LED’s on the control panel. I want the “active” relays indicated with a solid lit LED, and the “cursor” position to be indicated by a flashing LED.
I understand that to output to all of these LED’s I’m going to need to use a shift register, which I have purchased. The trouble is, I don’t even know where to begin with coding this thing. If I used an arduino mega board, it would be easy, I would just give each lamp it’s own pin and call it a day. Anyone able to walk me through this, or offer some advice on how to set it up?
I’m also working on adding a full-function remote control, but more on that later…
I’ve attached the code for the relay switching, as it’s too long to embed on the forum.
Trailer_Tester.ino (7.96 KB)