Hello there,
I've been looking for some help on my specific topic, but I don't believe I can find anything on the forum as of yet. I am using a MUX shield II from Mayhew labs to create a reactive LED table. I currently have 12 infrared sensors in close proximity to infrared emitters. These sensors are being fed into the inputs of the mutiplexer section of the board, and we are using the shift registers to allow the cathode of an LED cluster to go LOW and drop the necessary voltage.
Currently, I have run tests of my board with the MUX library examples, I know I am able to obtain accurate sensor readings, and write to all the available LED clusters.
My problem with this project, I believe comes from running inefficient programming, and not fully understanding how to effectively write to the shift registers.
My program consists of a setup loop where 25 readings of each sensor are obtained and then an average is computed for each sensor.
Then the loop executes, it uses 12 IF statements to compare the current analog read value to the average sensor value, and writes the LED closest to that sensor LOW(my logic is reversed because I am supplying 5V to all LED clusters, and using the shift registers to allow the clusters cathodes to be grounded and let the voltage drop).
I think that there is a much more effective way to handle this, perhaps by calling individual functions for each instance of sensor readings.
Currently, I can get favorable results by only programming one row of shift registers at a time. When I try communicating with rows 2 and 3 of the MUX Shield, extra data is written down the line from the activated sensor.
If anyone has any thoughts about this I will gladly post some of my code to take a look at this.