Thread: C coding
View Single Post
  #6   Spotlight this post!  
Unread 21-12-2007, 10:01
RyanN's Avatar
RyanN RyanN is offline
RyanN
AKA: Ryan Nazaretian
no team
Team Role: Mentor
 
Join Date: Jun 2006
Rookie Year: 2005
Location: Austin, TX
Posts: 1,127
RyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond reputeRyanN has a reputation beyond repute
Re: C coding

Welcome to programming! I just learned how to program a few months ago, and I'm pretty good now. If you're anything like me, then you learn by a hands on example. To get started, download the robot code off of ifirobotics.com; while at IFI, download the IFI_Loader. Next you'll need MPLAB with the C18 compiler. The main program you'll program with is User_Routines.c Just look at the code and try to figure out how it works. pwm?? are the PWM outputs on the controller. 127 is center/off. Relays are H bridges, so fwd triggers one relay, and rev triggers the other relay. If you have both on or both off, whatever you are controlling will remain off. You must have a 1 and 0 or a 0 and 1 to turn something on. In robotics, you will usually leave rev at 0 and then turn fwd on and off because of the polarity of the devices. Controls are pretty simple too, it's all in user_routines.c Good luck with programming and feel free to contact me.
__________________
Taking a break from mentoring for a few years. (Is that allowed?!?)

Controls Mentor
@rnazaretian

Previous teams:
Team Fusion, FRC 364
Garnet Squadron, FRC 4901
Reply With Quote