View Single Post
  #1   Spotlight this post!  
Unread 29-05-2006, 09:45
tacman1123 tacman1123 is offline
Registered User
AKA: Tac Tacelosky
FRC #1900
Team Role: Mentor
 
Join Date: May 2006
Rookie Year: 2006
Location: Washington, DC
Posts: 17
tacman1123 is an unknown quantity at this point
Send a message via AIM to tacman1123
Vex Library and Sample Code

I'm not an experienced C programmer, but have enough programming experience to make significant changes to a working program or library. I've been using EasyC, and finally got MPLab working, with the EasyC library and also with the VexCode library.

Is there something in between -- a simplified but open source library? For example, I want to make a fairly small change -- the Arcade2() function in EasyC sets the RC to an arcade-style controller, and maps the controller to a motors in a particular direction. I need to dampen the output, and limit it, so that the extremes of the joystick are not 0 and 255 but rather 100 and 150. I can't see where to modify the code to do this (obviously, I can't modify the EasyC). I've poked around the VexCode c and can't find where the RC is read, but even if I could, it appears that so much of the code is very low-level.

What I'm really looking for is a library (like the EasyC library, but with source code) that I can modify. Also, a set of high-level calls (reading a switch value, or setting a motor) using the VexCode, rather than EasyC, library would be helpful.

Right now, it appears that my choices are very high-level, limited functionality with EasyC, or low level bit manipulation, PWM and lots of hex values. Is there a way to say
Code:
   if (get_input(1) == 0) { // limit switch pressed
      set_motor(1, motor_speed);
   }
without having to write get_input() and set_motor(), but with the ability to modify them?

Thanks!

Tac
Reply With Quote