Page 010 6in6out Example - johnmholmes/Arduino-CBUS--Introduction-Series GitHub Wiki

Page update 5/10/24

CAN6in6out

  • This is my example to give me 6 inputs and 6 outputs.
  • The input pin takes 5 volts from the Arduino processor and is held at 5 volts until you ground it via a switch , push button, infrared sensor modules, Diode drop modules, Current senor modules.
  • The output pin will provide 5 volts, but is limited to a maximum of 20 milliamps. There is a total limit that the processor can supply, so it is best practice to lower the current draw as possible with a suitable resistor. This can be used to drive LED's, suitable relay modules,

Video showing changes

4 minute video

  • Line 99 unsigned char mname[7] = { '6', 'I', 'N', '6', 'O', 'U', 'T' };
  • Line 108 const unsigned long CAN_OSC_FREQ = 8000000; // Oscillator frequency on the CAN2515 board
  • Line 111 const byte LED[] = { 3, 4, 5, 6, 7, 8 }; // LED pin connections through a 1K8 resistor
  • Line 112 const byte SWITCH[] = { A0, A1, A2, A3, A4, A5 }; // Module Switch takes input to 0V.
  • Due to minor tweaks to the code the line numbers may change without notice.

Conclusion

This sketch offers me a lot of options on my layout and for the cost of each unit, makes this a great solution for mimic panels. Also for controlling various animations as well. Some of these may require a separate Arduino if they are more advanced animations.