View unanswered posts | View active topics It is currently Sat Nov 29, 2014 2:40 am






Reply to topic  [ 3 posts ] 
Results flicker from digital inputs 
Author Message
Rookie

Joined: Wed Oct 19, 2011 11:29 am
Posts: 4
Post 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
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 406
Post 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.

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Thu Oct 20, 2011 2:06 pm
Profile
Rookie

Joined: Wed Oct 19, 2011 11:29 am
Posts: 4
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.