Okay, here is code from our robot this year. This is exactly how we have written it and it works.
We made variables on top of the file:
Code:
unsigned int BottomSonic = 0;
Then, inbetween Getdata and Putdata, we inserted these two lines:
Code:
Getdata(&rxdata);
TopSonic = Get_Analog_Value(rc_ana_in02);
printf("Top: %d\r\n", TopSonic);
Putdata(&txdata);
If you have it wired up correctly, then the code above will work.
Also, try it on a fresh piece of code with the absolute default code from IFI.