View Single Post
  #6   Spotlight this post!  
Unread 29-05-2006, 22:50
foobert foobert is offline
Registered User
no team
 
Join Date: May 2005
Location: oakland, ca
Posts: 87
foobert is a jewel in the roughfoobert is a jewel in the roughfoobert is a jewel in the rough
Re: Vex Library and Sample Code

Quote:
Originally Posted by tacman1123
I'm hoping I'm missing something really obvious. I've looked though the ifi_*.c files, and the .h files, and everything is very low-level. I was using get_input(1) as an example, but I don't believe there is a get_input function. Is there one? If so, where is it?

Is there sample code somewhere that turns two motors on and goes for 5 seconds, or reads a switch (or even better, the remote control unit)? Right now, it looks like if you want to simply go forward for 5 seconds, you have immerse yourself in hundreds of lines of code. Again, I keep hoping there's some high-level function calls documented somewhere that I just can't see (again, beside the ones in EasyC).


Tac
oops. sorry, thought you were maybe talking about some existing easyC code about which i know nothing.

to test for a limit switch closed on pin 1 in the analog/digital section of the rc and then send the damped signal from channel 1 of the radio to a motor connected to motor port 1 on the rc, use

if (rc_dig_in01 == 0)
pwm01 = pwm_in1 / 5 + 100;

the names used are all defined in ifi_aliases.h. the code would probably go into user_routines.c which runs every 18.5 ms.
Reply With Quote