Go to Post I think this thread needs a reminder that there's no h in mecanum. ;) - Lil' Lavery [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 13-03-2008, 11:24
Jimmy_Team7011 Jimmy_Team7011 is offline
Registered User
FTC #7011
 
Join Date: Nov 2007
Location: Brazil
Posts: 3
Jimmy_Team7011 is an unknown quantity at this point
More than 1 autonomos...

It might be such a dumb question, but at the last competition here there were some teams with more than one autonomos programing , and then, they placed jumpers interrupts in the vex rc to change between these programs, is that possible to do , or were they just trying to make us fool?


If there is any way to do it, how?
  #2   Spotlight this post!  
Unread 13-03-2008, 13:00
whitetiger0990's Avatar
whitetiger0990 whitetiger0990 is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Earth
Posts: 157
whitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of light
Re: More than 1 autonomos...

Yup, we did this last year for FRC and just plain old C, but the logic should be the same, and it's good to understand the logic. We had a lot of digital ports opens, we wired up some pwms to a DIP switch and put it on the digital ports.
Code:
Auto_Mode=RC_dip_8;
Auto_Mode=(Auto_Mode << 1) | RC_dip_7;
Auto_Mode=(Auto_Mode << 1) | RC_dip_6;
Auto_Mode=(Auto_Mode << 1) | RC_dip_5;
Auto_Mode=(Auto_Mode << 1) | RC_dip_4;
Auto_Mode=(Auto_Mode << 1) | RC_dip_3;
Auto_Mode=(Auto_Mode << 1) | RC_dip_2; 
Auto_Mode=(Auto_Mode << 1) | RC_dip_1;
Basically with 8 switches, you could have 256 possibilities of autonomous modes. The << shifts all the bits in the number left one (basically multiplying the number by 2), and then ORing it with the next switch. In the end you have a char (a number which is 1 byte long, or 8 bits) and 8 switches, each one controlling one of the bits. So by having the switches flipped in different combinations, you have a range from 0 to 255. From that number you can switch statement or just if statements to control what the bot does.

We had no use for that many, but we had the space for it. The number of options you can have is 2 raise to the number of switches used. =)
__________________
print$q=chr(ord($q)+$1)while("7443-0201-8465130105-12-03135-82482113-06-7672-070208-0613-70"=~/(-?\d\d)/g);
  #3   Spotlight this post!  
Unread 13-03-2008, 18:08
thefro526's Avatar
thefro526 thefro526 is offline
Mentor for Hire.
AKA: Dustin Benedict
no team (EWCP, MAR, FRC 708)
Team Role: Mentor
 
Join Date: Aug 2006
Rookie Year: 2005
Location: New Jersey
Posts: 2,599
thefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond repute
Send a message via AIM to thefro526 Send a message via MSN to thefro526
Re: More than 1 autonomos...

A real easy way to do it in EasyC is to use some code like this.

If Digital Input == 1
Do stuff
Else If Digital Input == 0
Do other stuff

and so on and so forth
__________________
-Dustin Benedict
2005-2012 - Student & Mentor FRC 816
2012-2014 - Technical Mentor, 2014 Drive Coach FRC 341
Current - Mentor FRC 2729, FRC 708
  #4   Spotlight this post!  
Unread 16-03-2008, 12:18
Jimmy_Team7011 Jimmy_Team7011 is offline
Registered User
FTC #7011
 
Join Date: Nov 2007
Location: Brazil
Posts: 3
Jimmy_Team7011 is an unknown quantity at this point
Re: More than 1 autonomos...

Oh...so its possible.....but i couldnt understand how to do it....could sb explain?



thanks
  #5   Spotlight this post!  
Unread 16-03-2008, 13:55
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,007
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: More than 1 autonomos...

Um, I think they just did.

Let's say that in Autonomous 1 you want the robot to turn left, and Autonomous 2 you want it to turn right.

Code:
If (Digital_input_1 = 1) then
     [Code to turn left]
EndIf
If (Digital_input_2 = 1) then
     [Code to turn right]
EndIf
Now, you need to think more about this, because what happens if there are jumpers on both inputs 1 and 2? (someone forgot and put both on). And a lot of IF statements might become impractical if you have 25 different autonomous modes.

Also, make sure there's always one choice for "do nothing".

Don
__________________

I am N2IRZ - What's your callsign?
  #6   Spotlight this post!  
Unread 16-03-2008, 15:33
SL8's Avatar
SL8 SL8 is offline
...
AKA: Jesus
FRC #0647 (Cyber Wolf Corps)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Killeen, Texas (Fort Hood)
Posts: 352
SL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud of
Send a message via Yahoo to SL8
Re: More than 1 autonomos...

Quote:
Originally Posted by Don Rotolo View Post
Also, make sure there's always one choice for "do nothing".
Don
THis is especially important cause otherwise youre robot will be stuck doing what ever it was supposed to do last.
__________________


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
more than 4 ir controls? Vanquish Programming 2 12-01-2008 14:52
Robowarriors: More visited than CD! Tim Arnold General Forum 11 26-10-2007 11:54
Software on more than one machine PhatalEphekt Inventor 4 20-01-2004 12:19
More than 2 pneumatic tanks? kangarue23 Pneumatics 10 01-05-2002 12:14


All times are GMT -5. The time now is 15:47.

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