![]() |
Got it working now theres another problem!
Ok, the camera is working fine (altho i have no clue what do for the autonomous coding with including the camera) but anyhow we are using 6 diff autonomy codes and we have a dip switch pluged into rc_dig_in11 - 16 and the coding looks for which one is true then goes to that code, i have the LEDs on the control board light green when one of those return true (as a way to easily tell which mode we are using for that match) but when i merge my coding (just the LED defining for the rc_dig_in ports) with the camera coding, the LEDs dont light up, also i have tried just the main camera coding (with out my modifications) can any one tell me what to do about this?
|
Re: Got it working now theres another problem!
Where in the program did you put the code that controls the OI LEDs? If it's in Default_Routine(), did you remember to uncomment the call to it from Process_Data_from_Master_Up()? If it's somewhere else, did you remember to remove the original LED control code from the program?
|
Re: Got it working now theres another problem!
im not sure exactly, all i know its in the LED output section of User_Routines, i dont know really anything about the coding for the cam so i dont know what needs to be un commented or commented out and i did comment out the original LED output coding, and it works fine with my modified defult code but not with the modified camera code, in fact the LED that should light up when the camera has a green target doesnt light up either, even with an un modified cam User_Routines.
|
Re: Got it working now theres another problem!
Quote:
|
Re: Got it working now theres another problem!
i just un comment the one line that says defult_routine; (something like that) right? because i did that and the camera didnt track the green then
|
Re: Got it working now theres another problem!
Make sure the pwm output code in Default_Routine() isn't conflicting with the camera servo control. As provided, the camera code wants the pan and tilt servos on pwm01 and pwm02. Also as provided, the default pwm code copies joystick inputs to those same pwm outputs. You'll have to either strip the pwm01/pwm02 control from Default_Routine() or move the camera servos to other outputs (details are in tracking.h).
Note: avoid using pwms 13-16. Hardware interrupts, including the interrupt-based serial communication, will interfere with the "fast update" pwm routine for those outputs and cause unwanted jitter in the servo or speed control signals. |
Re: Got it working now theres another problem!
ok i uncommented Default_Routine() and went into tracking.h and chaned it from pwm01 - 02 to pwm11 - 12 and when i load the code the camera doesnt do anything (my LEDs light up) am i just not understanding that the camera isnt going to do anything till it has autonomy code? we want to use it as an aiming device during the match, i think im just confused
|
Re: Got it working now theres another problem!
The very beginning of Default_Routine() has this code:
Code:
/*---------- Analog Inputs (Joysticks) to PWM Outputs----------------------- |
Re: Got it working now theres another problem!
you know, for some reason when we set our camera's PWM output to a value other then 1 or 2, we got issues. maybe its the same for you?
also, do what alan anderson told you to, because that same error (my stupidity...) gave us that problem at the begging of the season. |
Re: Got it working now theres another problem!
Remember, when something is plugged into rc_dig_in[1-16] it is on, when the switch is actually off:
switch off == 1 in code switch on == 0 in code This caught me by surprise. My team used rc_dig_in[1-3] to create 7 different modes: 000 = off 001 = 1 010 = 2 011 = 3 100 = 4 101 = 5 110 = 6 111 = 7 Code is below for what you can use to do this. Stick it in user_routines_fast.c to make use of it, make sure to change it to what you need to use it for :P. Code:
unsigned int Auton = 0; |
Re: Got it working now theres another problem!
Quote:
what type of switch did u use? |
Re: Got it working now theres another problem!
Quote:
PWM cable, connect the two outside ones. The signal line, and the ground line. I believe it was black and white. Red was simply cut down as closely to the connector as possible, so that the 5v would not cause any trouble. We had some bad PWM cables that got cut open by accident by scraping along the frame, so we cut them, and simple twisted them together, and then right before a match plugged in the ones we wanted, and removed the ones we did not want, and we were set. |
| All times are GMT -5. The time now is 03:13. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi