|
Page 1 of 1
|
[ 3 posts ] |
|
Results flicker from digital inputs
Author |
Message |
homer1959
Rookie
Joined: Wed Oct 19, 2011 11:29 am Posts: 4
|
 Results flicker from digital inputs
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 am Posts: 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.
|
Thu Oct 20, 2011 2:06 pm |
|
 |
homer1959
Rookie
Joined: Wed Oct 19, 2011 11:29 am Posts: 4
|
 Re: Results flicker from digital inputs
Thanks,
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.
Thanks again
|
Thu Oct 20, 2011 4:03 pm |
|
|
|
Page 1 of 1
|
[ 3 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|