Go to Post Safety captains be watchful. - Al Skierkiewicz [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-01-2006, 14:32
Erics626's Avatar
Erics626 Erics626 is offline
Cool, Calm, Collected
None #1018 (Robodevils)
Team Role: Electrical
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Pike High School, Indianapolis, Ind
Posts: 69
Erics626 is a jewel in the roughErics626 is a jewel in the roughErics626 is a jewel in the rough
Send a message via AIM to Erics626
easyC trouble

Is there anyway to execute multiple if statements, while statements, or user functions that I wrote at the same time?
__________________
Championship Finalist - 2006 Buckeye Regional (Thanks 461 and 141!)
Fourth Year FIRST Member
Third Year Electrical Team Leader
First Year BEST and FIRST Robotics Team Co-Leader
Second Place - Robotics Competition, 2005 Bearcat BEST
Second Place - BEST Competition, 2005 Bearcat BEST
Most Photogenic - 2005 Bearcat BEST
Most Robust - 2005 Bearcat BEST
Fourth Place - Robotics Competion, 2005 Nationals(South's BEST)
"Get your philosophy from a bumber sticker."-Billie Joe Armstrong
  #2   Spotlight this post!  
Unread 21-01-2006, 14:36
sirbleedsalot's Avatar
sirbleedsalot sirbleedsalot is offline
Registered User
FRC #0939
Team Role: Student
 
Join Date: Feb 2004
Location: New Effington South Dakota
Posts: 178
sirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura about
Re: easyC trouble

Is there anyone out there that would be willing to visit with us on the phone, we are having trouble getting easyc started. If you are interested in this you could email me with your number. My email address is dayle.haaland@k12.sd.us.
Thanks for any help.
__________________
our web site
  #3   Spotlight this post!  
Unread 21-01-2006, 14:36
BrianBSL BrianBSL is offline
Registered User
FRC #0190
 
Join Date: Sep 2004
Rookie Year: 2000
Location: Worcester, MA
Posts: 251
BrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud ofBrianBSL has much to be proud of
Re: easyC trouble

Quote:
Originally Posted by Erics626
Is there anyway to execute multiple if statements, while statements, or user functions that I wrote at the same time?
All simultaneously? The PIC has no support for multi-threading built in, and isn't really fast enough to implement an "operating system" that would implement this.
__________________
My posts represent my personal views only, and do not represent the views of either my team, Team 190, nor its primary sponsor, Worcester Polytechnic Institute.
  #4   Spotlight this post!  
Unread 21-01-2006, 14:41
Erics626's Avatar
Erics626 Erics626 is offline
Cool, Calm, Collected
None #1018 (Robodevils)
Team Role: Electrical
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Pike High School, Indianapolis, Ind
Posts: 69
Erics626 is a jewel in the roughErics626 is a jewel in the roughErics626 is a jewel in the rough
Send a message via AIM to Erics626
Re: easyC trouble

Perhaps I should be more specific. We are trying to write a program for count wheel rotations. We want the left wheel to travel a different number of rotations than the right wheel. I created two different user functions, one for counting the left wheel and one for counting the right wheel. We implemented these functions into autonomous, but the wheels do not start at the same time. Instead, the left wheel goes the distance we set, and as soon as the left wheel is done, the right wheel begins to rotate and start its count.
__________________
Championship Finalist - 2006 Buckeye Regional (Thanks 461 and 141!)
Fourth Year FIRST Member
Third Year Electrical Team Leader
First Year BEST and FIRST Robotics Team Co-Leader
Second Place - Robotics Competition, 2005 Bearcat BEST
Second Place - BEST Competition, 2005 Bearcat BEST
Most Photogenic - 2005 Bearcat BEST
Most Robust - 2005 Bearcat BEST
Fourth Place - Robotics Competion, 2005 Nationals(South's BEST)
"Get your philosophy from a bumber sticker."-Billie Joe Armstrong

Last edited by Erics626 : 21-01-2006 at 14:49.
  #5   Spotlight this post!  
Unread 21-01-2006, 14:59
ahecht's Avatar
ahecht ahecht is offline
'Luzer'
AKA: Zan
no team
Team Role: Alumni
 
Join Date: Dec 2001
Rookie Year: 2002
Location: Billerica, MA
Posts: 978
ahecht has a reputation beyond reputeahecht has a reputation beyond reputeahecht has a reputation beyond reputeahecht has a reputation beyond reputeahecht has a reputation beyond reputeahecht has a reputation beyond reputeahecht has a reputation beyond reputeahecht has a reputation beyond reputeahecht has a reputation beyond reputeahecht has a reputation beyond reputeahecht has a reputation beyond repute
Send a message via ICQ to ahecht Send a message via AIM to ahecht Send a message via Yahoo to ahecht
Re: easyC trouble

You will need to combine the counting code for both wheels into a single user funtion or loop.

Also, this thread should probably go in the EasyC for FRC sub-forum
__________________
Zan Hecht

Scorekeeper: '05 Championship DaVinci Field/'10 WPI Regional
Co-Founder: WPI-EBOT Educational Robotics Program
Alumnus: WPI/Mass Academy Team #190
Alumnus (and founder): Oakwood Robotics Team #992


"Life is an odd numbered problem the answer isn't in the back of the book." — Anonymous WPI Student
  #6   Spotlight this post!  
Unread 22-01-2006, 03:16
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: easyC trouble

Quote:
Originally Posted by Erics626
Perhaps I should be more specific. We are trying to write a program for count wheel rotations. We want the left wheel to travel a different number of rotations than the right wheel. I created two different user functions, one for counting the left wheel and one for counting the right wheel. We implemented these functions into autonomous, but the wheels do not start at the same time. Instead, the left wheel goes the distance we set, and as soon as the left wheel is done, the right wheel begins to rotate and start its count.
I'm not sure exactly what you are really trying to do - sounds like making a turn using the wheel encoders. But to do literally what you asked for, you need to start both wheels going. Then in a loop, read each wheel count, and using two IF statements, stop each wheel when its count is greater than or equal to the count your are looking for.
That way the wheels will both be running at the same time and they will each stop independently after the correct number of rotations.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #7   Spotlight this post!  
Unread 22-01-2006, 03:21
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: easyC trouble

Quote:
Originally Posted by sirbleedsalot
Is there anyone out there that would be willing to visit with us on the phone, we are having trouble getting easyc started. If you are interested in this you could email me with your number. My email address is dayle.haaland@k12.sd.us.
Thanks for any help.
Before talking on the phone, can you be more specific about what doesn't work? Do you mean you installed it, and it doesn't run when you start it from the start menu? Or that robot programs you write don't start? Or you're having trouble getting started using EasyC?
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #8   Spotlight this post!  
Unread 22-01-2006, 19:03
sirbleedsalot's Avatar
sirbleedsalot sirbleedsalot is offline
Registered User
FRC #0939
Team Role: Student
 
Join Date: Feb 2004
Location: New Effington South Dakota
Posts: 178
sirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura about
Re: easyC trouble

Quote:
Originally Posted by BradAMiller
Before talking on the phone, can you be more specific about what doesn't work? Do you mean you installed it, and it doesn't run when you start it from the start menu? Or that robot programs you write don't start? Or you're having trouble getting started using EasyC?
We are having trouble getting started, like is there a default code to work off of ?And then how do you change that code?
__________________
our web site
  #9   Spotlight this post!  
Unread 22-01-2006, 21:39
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: easyC trouble

Quote:
Originally Posted by sirbleedsalot
We are having trouble getting started, like is there a default code to work off of ?And then how do you change that code?
Good question!
The default code is there, but it's built-in. You just write programs that operate the robot and don't need to look at anything else. You can literally write 10 line (block) programs that drive using the gyro or camera for control.

Check out the tutorials in EasyC to get an idea of where to start. If you are still having trouble - send me email and we can talk off-line.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #10   Spotlight this post!  
Unread 28-01-2006, 13:28
sirbleedsalot's Avatar
sirbleedsalot sirbleedsalot is offline
Registered User
FRC #0939
Team Role: Student
 
Join Date: Feb 2004
Location: New Effington South Dakota
Posts: 178
sirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura aboutsirbleedsalot has a spectacular aura about
Re: easyC trouble

ok i've got my robot to drive and turn, using easyc to write the code, however i have another motor that i want to be able to turn on by pressing the trigger button on the joystick how do i write code for that, and that will turn the motor counter clockwise then if i release the trigger i want the motor to stop then if i press the thumb button the motor will turn clockwise, can someone give me detailed instructions.
__________________
our web site
  #11   Spotlight this post!  
Unread 02-02-2006, 08:10
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: easyC trouble

Quote:
Originally Posted by sirbleedsalot
ok i've got my robot to drive and turn, using easyc to write the code, however i have another motor that i want to be able to turn on by pressing the trigger button on the joystick how do i write code for that, and that will turn the motor counter clockwise then if i release the trigger i want the motor to stop then if i press the thumb button the motor will turn clockwise, can someone give me detailed instructions.
Inside the loop where you are driving the robot, you need to read the trigger inputs from the joystick and operate the motors.

To read the trigger inputs, use the "Digital OI Input" block. It returns a 1 or a 0 depending on the state of the trigger. You can check that value and then decide whether or not to drive the motor. To operate the motor, use the "PWM Control" block. It takes a PWM port number and a speed.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Closed Thread


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
EasyC v2.0 is mandatory for FVC! skimoose FIRST Tech Challenge 7 14-01-2006 18:37
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12
EasyC v. 2.0 - New features, custom user functions, and more! artdutra04 FIRST Tech Challenge 1 02-11-2005 13:36


All times are GMT -5. The time now is 06:13.

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