![]() |
Problems Combining Camera Code and Driving Code
I have both the camera code and the driving code working independently :) , but I've been having some trouble combining them. I've added both user_SerialDrv.c and user_SerialDrv.h to the camera code and uncommented the IFI code in user_routines.c as well as in user_routines_fast.c. I've also tried to change the pwm output assignments of either our two drive motors or the camera servos. When I left the servos on pwm01 and pwm02 and changed the pwms for the motors the camera worked and the driving didn't. When I switched them the driving worked and the camera didn't, in fact, the camera just sat there and twitched. :ahh: Then, I assigned the servos to pwm01 and pwm02 and the motors to pwm05 and pwm06. The camera froze in home position and the driving worked for about 30 seconds before halting and displaying a code error. If anyone has any idea how I can fix this I'd really appreciate it.
Thanks |
Re: Problems Combining Camera Code and Driving Code
Quote:
-Kevin |
Re: Problems Combining Camera Code and Driving Code
I'm kind of in the same boat, and will be working on combining them this week. If I discover the secrets, I'll post...
I'll be eager to see if you find anything out as well! |
Re: Problems Combining Camera Code and Driving Code
Quote:
(1) As Kevin says, the camera's serial code needs serial.c and serial.h from his code, and not the user_SerialDrv.c/h. You need to remove those from the project. (2) Similarly, Kevin's serial code requires the interrupt routines in user_routines_fast.c to be correct (if you don't have this correct, you'll get the red light of death). If you aren't using other special interrupt code (encoders or the gyro), just copy user_routines_fast.c from Kevin's camera code and try that. Otherwise, you'll have to make sure all the appropriate interrupt handlers are in place for all the codes you are using. This can be done, our bot's testbed code now has the camera, gyro, shaft encoders, and two additional ADC channels running at the same time, but it's tricky and requires careful reading of the adc_readme.txt, encoder_readme.txt, camera_readme.txt, etc. (And we didn't get it right the first time, as you can see if you look the other places I've posted). |
Re: Problems Combining Camera Code and Driving Code
Quote:
-Kevin |
Re: Problems Combining Camera Code and Driving Code
Quote:
|
Re: Problems Combining Camera Code and Driving Code
Thanks
The problem was definately with SerialDrv.c/.h I didn't have problems with user_routines_fast.c because I started with the camera code and adapted that for driving. Thanks for all your help. It works wonderfully now and the next challenge is getting the camera to track using the motor on our rotating turret. :cool: Thanks again and thanks for all the great code Kevin. You rock. |
Re: Problems Combining Camera Code and Driving Code
Thanks for sharing all this information-- it's been helpful. :D
We have followed the serial_ports_readme instructions, we're using Kevin's camera code user_routines_fast.c interrupt handlers, and we tried to remove user_serial_drv.c. We had a problem with this last action-- the function breaker_tripped was called in user_routines.c, and it is declared in User_serial_drv.c, so we can't compile :confused: Has this happened to anyone else? What did you do? |
Re: Problems Combining Camera Code and Driving Code
Quote:
-Kevin |
Re: Problems Combining Camera Code and Driving Code
Quote:
Thank you for your reply! :D We have yet another question... We are using four circuit breakers: the maxi style circuit breaker panel, the 120 Hi-Amp circuit breaker, and two other circuit breaker panels that came with the KOP. Is the circuit breaker you meant among those four? |
Re: Problems Combining Camera Code and Driving Code
Quote:
-Kevin |
Re: Problems Combining Camera Code and Driving Code
Quote:
When combining the camera and interrupt code, how many timer interrupts are required? Any other details? So far I'm still getting the RLOD!!!! Jon Mittelman Team236 |
Re: Problems Combining Camera Code and Driving Code
Quote:
We do use all of those, and it's working fine. Here's our InterruptHandlerLow: Code:
#pragma code |
Re: Problems Combining Camera Code and Driving Code
Quote:
Any other thoughts? Jon |
Re: Problems Combining Camera Code and Driving Code
Quote:
|
| All times are GMT -5. The time now is 03:46. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi