I am designing a smart (or at least I hope so) onboard bicycle light system. The system will have an Arduino (currently prototyping with UNO) and a subsystem composed of a "panel" of buttons and leds.
This panel should stay at the handlebar, connected by multi-wire cable to the Arduino located elsewhere on the bicycle.
In order to read an arbitrary number of push-buttons, I plan to use CD4021 IC with shiftIn()
function. And, in order to turn an arbitrary number of leds on and off, I plan to use 74HC595 IC and the shiftOut()
function.
My doubts are: what should I consider in order to do so?
How many wires should I need to connect an arduino to the panel circuit containing the ICs? I believe it is 8 wires (two for the power, three for shifting in [latch, clock, data], and three for shifting out), right?
Can I use any pin I want? Or is it required to use specific pins?
Is that the "right way" of doing this? Any suggestion or improvement is welcome!
shiftIn()
tutorial, what would these shortcomings be? What other shift register could be used instead? Also, the I2C tip is interesting, are those parts expensive in comparison? How should I search for one, and what would be a good 8 channel "equivalent" to the parts I mentioned? – heltonbiker Jun 24 '15 at 12:48