View Full Version : Need some help with
I've connected everything on the correct ports, but for some reason this won't work. When I run the program nothing happens when the condition is met.
Here are some pics:
Begin:
http://i.imgur.com/S6u2Jo6.png
Teleop:
http://i.imgur.com/PfyjZ9v.png
Thanks in advance!
Mark McLeod
22-12-2014, 13:49
The Pot will never exactly equal 5.
You might want to use > 4.9 or something.
Try probing the actual pot values so you know what you are getting.
The Pot will never exactly equal 5.
@OP: Mark's statement applies not only to your particular issue: It applies whenever you are comparing floating-point numbers in a computer program.
Here are a couple of articles which may be of interest:
http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
http://c-faq.com/fp/fpequal.html
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.