![]() |
Programming help
This is my first time programming the robot for our team. I was looking a tthe tracker code and cannot see how it works.
I can see that there are two sensors for each side. On the left side, you have a left and a right detector and on the right side, you have a left and a right detector. All I could find in the tracker code was one digital input defined. How do I connect up the 4 ir sensors and how do I code in the extra inputs to make this work? I have been basing most everything off the default code... I still am not quite certain how to use the spike relays either... Nick |
Re: Programming help
Quote:
As for relays, thats very simple. Relays operate in 3 states. Forword, reverse, and neutral. Each relay relies on 2 binary varriables to deturmine its state. Lets use relay 1 for an example. If you wanted to set relay 1 forward you would do relay1_fwd=1; relay1_rev=0; for reverse you would do relay1_fwd=0; relay1_rev=1; For neutral they would both be zero. DONT set them both to one! Hope this helps |
Re: Programming help
Looking at the default code
Navigate.h contains Left Sensor servo in pwm01 Right Sensor servo in pwm02 Left Drive Motor in pwm03 Right Drive Motor in pwm04 The IR Sensors 1,2,3,4 are configured like this 1 - Left/Left (LL) - Left Sensor on Left Servo 2 - Left/Right (LR) - Right Sensor on Left Servo 3 - Right/Left (RL) -Left Sensor on Right Servo 4 - Right/Right (RR) - Right sensor on Right Servo They get plugged into LL - digital 3 LR - digital 4 RL - digital 5 RR - digital 6 The Digital input rc_dig_07 (digital 7) is the switch which states which beacon you are going to chase. Wire a toggle switch on you robot and plug it into Digital 7. When you set up you robot on the field, you can flip this switch to have the code point to the beacon emmitting the "0" pulse or the beacon emitting the "1" pulse. Hope this helps. Phil |
| All times are GMT -5. The time now is 04:22. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi