I'm trying to make a continuity tester at work where I connect the input and output of a harness into a test fixture powered by an Arduino. This tester tests whether the position of the connects are pinned correctly.
From one end of the connector (the output in the diagram), I want to shift in a binary that is in the power of 2. For instance, shifting in 0001 , check for continuity by reading the 75HC165 (parallel in, serial out), then clear the register and then shift in 0010 , and then 0100 and so on. For a correctly pinned harness, the write and read binary subtraction will be zero.
Here is my loop that attempts to perform the above:
I am testing this concept on a breadboard with LEDs and the above kind of works. However, the LED is lit up one at a time and they don't turn off, not following the binary.
The use of pow. pow does return a double (depending on the Arduino, that can be a float instead) and floating point numbers are not necessarily exact. Below code demonstrates
Don't forget to put some light (10k?) pull-up or pull-down resistors on your 74HC165 input pins. You don't want to accept a broken wire because the input pin happened to float to the expected value.
It would save you from the manipulations involving 'pow()'... although you can also fix that in code now.
I know I am making a subtle point, but since you have shift registers both sending and receiving from the matrix, there is no need to ever do shift operations in software.
I am still trying to learn about this shift register and I'm trying to shift 11111111 to the register and this should light up all the LEDs. However, only 7 of them lit up and Q0 doesn't seem to have any output voltage, sometimes that troublesome LEDs flickers very dimly and sometimes it doesn't flicker at all.
I have done research and looked into varies posts regarding this and majority of them suggested to add in a decouple capacitor between the Vcc and GND on the breadboard. I have added in a 10uF capacitor and it doesn't seem to do anything....I am lost and don't know where I should look for answers.
Not all of it. Post it all so that we can see, for example, what latch_pin is declared as.
Incidentally, red is an odd choice of colour for a ground wire.
Pin 16 on the shift register is Vcc but following the Wire back to the Arduino, it lands on a GND pin. You have to clean up the schematic.
You can't measured voltage with an ohmmeter, only resistance. You need a volt meter for voltage.
It won't, you need a 0.1uF ceramic capacitor as physically close to the shift register power pins as possible. Plug the wires into the breadboard next to the shift register power pins. You can leave the 10uF capacitor where it is.
If there is a problem in code then it's in the bit you didn't post. I note there doesn't seem to be anything to stop the data being sent thousands of times per second.
is defined, it's missing from your code and might be the cause of your problem. Is it an inbuilt function somewhere? As you are trying to learn about shift registers I suggest you forget about shiftOut() and write your own function to do the shifting, you'll learn a lot more.
I only noticed this after I replied, I found you have another topic on the same subject.
Your two topics on the same or similar subject have been merged.
Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.
Repeated duplicate posting could result in a temporary or permanent ban from the forum.
Could you take a few moments to Learn How To Use The Forum
It will help you get the best out of the forum in the future.
I thought those two are different questions, this one is asking why Q0 has no input given I have done everything correctly. The another one was asking about the code, how to shift binary numbers around. thank you
Such questions may be unrelated when a system is working. When a problem exists, multiple facets often manifest themselves in multiple questions. Solving one, solves the other. Also with a non-working project, maximum context is provided by maximum information, which is best achieved by having it all in one thread.