Is it my USB?

Hello,

I am using a arduino mini. I have been using SparkFun RC robot control code. It used PulseIn to read pwm from a Tx. It was working great reading values from 1000ms to 2000. All of a sudden it stopped working. It now reads values from 0-12000 and occasionally it settles in 1000-2000 or settles at a constant 9000ms.

I can’t seem to diagnose the problem. Has my arduino broken? Am I getting some severe electrical interference? Has the internal clock broken(if that can happen).

The only topics I can fine on similar situations were people advising to use interrupts. Which I have tried. However I am getting the same situation.

Hopefully this is a troubleshooting topic?

My money is on a loose connection

If you're able to get any output on the serial port the usb-serial adapter is fine.

Assuming the code hasn't changed. If it has, it's a bug in the code you haven't posted.

I’ll have another go with the cables/ try the code/cAbles on another laptop.

Tried setup on another laptop. I am getting a consistent reading of anywhere from 0-10000

Here is the code I am using.

No lose connections. Code used to work perfectly...

FIXED!

so silly... I was feeding 6v into the vcc. Which was messing up the 5v Logic.

Regulated battery to 5V and it’s all working again...