If I perform any calculations, which involve a digital inputs the results flicker between the correct answer and another answer. I have tried multiplying the boolean input with a float. I have tried using an If statement to assign a value of 1 to a float then multiplying the two floats. For example, if I set val1 = 4 (float) when the digital input is hi, 0 else and then multiply val1 with 8.1, I will get an answer that flickers between 4 and 32.4. The result is always the same. The debug shows that the digital input is steady, not flickering, so does the DVM and the scope. I even loaded it with capacitance. No effect. FLICKER! Any ideas?

Wed Oct 19, 2011 11:38 am

jbflot

Site Admin

Joined: Tue May 15, 2007 9:02 amPosts: 409

Re: Results flicker from digital inputs

Keep in mind that the debug window on the screen isn't updating nearly as fast as your robot is getting values. Is it possible that the sensor itself is just spiking so quickly that you can't see it except with your calculations?

You could try replacing the SensorValue with a hard coded 1 and 0 to see if it happens independent of the sensor. If you post your code and your setup, I'll try to reproduce.

That's a good thought. But, I did look at the input on an o-scope and did not see any glitches. I also loaded it with .2 micro Farads, just in case. The hard coded numbers do not flicker. I don't get it yet.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum