Timing interval between output and input on pins

I suddenly got in a situation where everything stopped working. I'm using the same code as I posted earlier in this thread, but my reading just says 0 (microseconds). The circuit didn't change at all. I have no idea what to do. I'm unsure if I should make a new thread because I have already posted the code here, and it might seem like I'll be repeating some of the things in the new thread. I apologize if I'm asking too much.

Images: https://drive.google.com/drive/folders/1l-cihOBEqGCXYd5aGNDxdwGvyG2HZkbr?usp=sharing

Did you try the cycle counting approach? I've just corrected a bug in the posted assembler code..

Something obviously changed.

Upload the code to the Arduino again and check the wiring carefully. Are you using a breadboard ? If so check that all wires are connected properly and that the pins on the patch leads are actually connected to the wires

Danois90:
Did you try the cycle counting approach? I've just corrected a bug in the posted assembler code..

Using microseconds was easier, and worked perfectly yesterday. If I can't figure this out, I have to look into it.

Check your wiring (reseat everything), a dupont style jumper can easaly cause a bad connection in a breadboard.

UKHeliBob:
Something obviously changed.

Upload the code to the Arduino again and check the wiring carefully. Are you using a breadboard ? If so check that all wires are connected properly and that the pins on the patch leads are actually connected to the wires

I added a few images to the post above (couldn't add as attachments because of file size). Let me know if link doesn't work. I have uploaded code again at least fifty times. Wiring checked.

Looks like a short cirquit to me: Pin1 -> Resistor -> Resistor -> Pin2 :-?

It's based on the principle showed on this site: Capsense with Arduino

Did you read about "resistor choice" and "known issues" on that page? Also, I think your blue wire is placed wrong, shouldn't it be between the two resistors? Also mind that the breadboard itself may have some capacitance.

I figured I'd try fixing this for a good amount of time before going to the forum, but it actually seems like I found the fault just now. Very embarrassing. I had tried testing a lot of the pins, and switching wires and so on, but it seemed like I had placed one wire wrong. I'm so sorry for the trouble, guys. I appreciate the help. Regarding the issues talked about on that site – I'm not experiencing any of them in my current setup (now that it works). No noise, and it can sense a light finger touch through 4 mm glass. The resistors on my images are two 1.0 M in series (sorry if it was difficult to see). Again, thank you for all the help! :slight_smile: