Log in

View Full Version : Combining camera + encoder code


kiettyyyy
12-04-2006, 02:27
Hey all!

I took the camera.c, camera.h, tracking.h, etc.. and put it right into the encoder code that kevin watson designed earlier in the year. I did some slight modification to the code so that the camera doesn't use the servos to move, it uses the drive train to move around. I tested all the code in the normal camera version of the code, and it works flawlessly.

Now when I took the encoder version of the code and combined it with all the files that Kevin Watson specified to include in the code written in camera_readme.txt, serial_ports_readme.txt, and tracking_readme.txt. I have everything the readme ask for. The code builds, the encoders work, but the camera says that there is No Camera Found!!!!!!!

Any ideas!??!?!

Thanks! :eek:

The Lucas
12-04-2006, 05:41
are you handling the camera interrupts in user_routines_fast.c?

kiettyyyy
12-04-2006, 18:48
Yes I am :(.. Could it be that I called the get or put data after the startup of the serial ports? Who knows.. Ill try some other stuff at the practice field today.. talk to yall soon

Joe Ross
12-04-2006, 20:33
The encoder version of serial_ports.c sets serial port 2 (the TTL serial port) to 9600 bps while the camera version sets it to 115200.

Which one are you using? It should be the one from the camera.

kiettyyyy
13-04-2006, 00:53
Oh! Yeah i just found SPBRG2 = BAUD_9600; // baud rate generator register [251]

Was that what you meant?


Yep i found it inside the code now.. Ill replace it and test all of it tomorrow :)

Thanks everyone!

Joe Ross
13-04-2006, 09:39
Oh! Yeah i just found SPBRG2 = BAUD_9600; // baud rate generator register [251]

Was that what you meant?


Yep i found it inside the code now.. Ill replace it and test all of it tomorrow :)

Thanks everyone!



Make sure you change the line after it also to TXSTA1bits.BRGH = 1;

Or just copy the entire file from the camera project.