|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi everyone.
I'm a programmer on a rookie team and we are trying to set up our line sensors. The line trackers are set up according to the guide released by NI, http://decibel.ni.com/content/docs/DOC-14730,although we wrote our own program in C instead of LabView. Does anyone have any advice or see any errors? Also, I would like to try and debug this, but I can't find the target console! I think it's because I can't connect to the cRIO, but I can still upload programs to it! It's all very confusing. Yes, the cRIO has power when I am trying to connect it. Quote:
Last edited by Matt Daioh : 19-02-2011 at 03:07. Reason: Messed up the link, sorry! |
|
#2
|
||||
|
||||
|
Re: Line Tracking Code
There's a lot of problems.
1) Code:
/*DigitalInput(UINT32 slot, UINT32 channel);*/ DigitalInput photoSensor1(8,3); DigitalInput photoSensor2(8,4); DigitalInput photoSensor3(8,5); 2) Code:
/*getting digital input*/ photoSensor1.Get(); //get for sensor 1 photoSensor2.Get(); // get for sensor 2 photoSensor3.Get(); //get for sensor 3 Code:
bool left, middle, right; left = photoSensor1.Get(); //get for sensor 1 middle = photoSensor2.Get(); // get for sensor 2 right = photoSensor3.Get(); //get for sensor 3 Code:
if((!left) && (!middle) && (right)){
3) Code:
myRobot->Drive(0.1, 30.0); EDIT: There might be more, but that's what jumped out at me. Last edited by Redneck : 19-02-2011 at 13:24. |
|
#3
|
|||
|
|||
|
Re: Line Tracking Code
I suggest pulling out the Line Tracking example code and using it as a REFERENCE
In WindRiver go to New > Example > VxWorks Downloadable Kernel > FRC Line Tracker Sample Program. It can be very useful for getting an understanding to the way the sensors work |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|