Go to Post In the end, if our products are crap, then people will not buy them. This is the risk of doing business, and the foundation of capitalism. - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #23   Spotlight this post!  
Unread 11-01-2007, 10:29
jakk jakk is offline
Jonathan Kobayashi
FRC #0368 (Kika Mana)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hawaii
Posts: 39
jakk has a spectacular aura aboutjakk has a spectacular aura about
Re: What are we supposed to do!?!?!?!??!?!

Remember that this program actually runs in a HUGE loop. In other words, the program runs through lots of times per second. Program will check the status of the Operator Interface and will adjust the values of the PWMs accordingly. This is how the robot is able to have variable speeds.

As for the PWMs, looks in user_routines.c and look around for the "pwm=xx;" where xx is a number or perhaps another variable like the value of the joysticks.

The default code provided by FIRST controls the Kitbot rather nicely. If hooked up correctly, the Kitbot can move with either 1 joystick or 2.


-----------------------------
The following explaination is based off of the code we used 2 years ago. I'm sorry if I get some things wrong and if I do, please correct me. It has been 2 years since I was a programmer.

void User_Initialization (void)
this is where you initialize the ports on the RC. In other words, you are setting those pins on the Robot Controller to do something, like be an output(gives out power) or input(receives a signal for a sensor).

void Default_Routine(void)
this is where the controls are at. Remember how I said that the program runs in a HUGE loop? Well this is part of that loop. This function looks at all the values of the Operator Interface (like the joystick values) and through some "if" and "else" statements, it can control the motor's speed.

---------------------------------------

Like Qbranch said, easyC is a good introduction to C programming. I think it is setup so there is an "operator control" section and "autonomous" section so it well orgranized.
__________________
http://www.mckinleyrobotics.org
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What are Potentiometers? Theory6RobotiX Control System 18 30-12-2005 09:57
PBASIC 2.5 Software supposed to be released TODAY. Travis Hoffman Programming 7 13-01-2003 20:43
What are pneumatics? Aignam Pneumatics 23 16-10-2002 21:17
Who was supposed to be in Huntington?? Heather 45 Off-Season Events 4 16-03-2002 22:43


All times are GMT -5. The time now is 20:45.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi