Debugging can be very frustrating

I've just wasted about 2 hours trying to figure out why a digitalRead() was showing LOW when it should not have been.

I'm making a model train turntable and I have a few simple contacts to identify where it is. In the test program it should only stop briefly when it makes contact, but it was stopping randomly. It seemed to have been working fine last night.

Eventually, after suspecting cross-talk from the stepper wires (28Byj-48) and an inadequate pull-up resistor, and faulty code and goodness knows what else it finally dawned on me that contact was being made through the aluminium covering on the baseboard (Celotex) that had been pierced by a screw holding down one of the contacts.

Of course then there is the satisfaction of beating the bugger :slight_smile:

...R

Seems that some times, sh*t just happens to keep us on our toes. :frowning:

The hardest faults to find and rectify are those you caused yourself. A fresh pair of eyes can usually find that fault quicker.

Henry_Best:
The hardest faults to find and rectify are those you caused yourself. A fresh pair of eyes can usually find that fault quicker.

Or just asking on the forum what you did to cause the problem, with no other information given.

Paul

The trick is to realize that the things that "obviously cannot be happening" need to be checked
just as much as the things you suspect as possible.

MarkT:
The trick is to realize that the things that "obviously cannot be happening" need to be checked
just as much as the things you suspect as possible.

+1

This almost always catches out the people who only post snippets.

...R

Paul_KD7HB:
Or just asking on the forum what you did to cause the problem, with no other information given.

Paul

hahaha