Go to Post We have a little saying on our team. "Don't worry, we'll fix it in software." - klrswift [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 20-02-2006, 03:06
Idaman323 Idaman323 is offline
In Theory, Our Robot Would Own.
FRC #1706
Team Role: Driver
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Wentzville, MO
Posts: 116
Idaman323 is an unknown quantity at this point
Switches? Programming? Help? :)

Hey I programmed joystick triggers to make a motor go back and forth using:

Code:
if (p1_sw_trig == 1)
{
pwm06 = 0;
}
if(p2_sw_trig == 1)
{
pwm06 = 254;
}
if((p1_sw_trig == 0) && (p2_sw_trig == 0))
{
pwm06 = 127;
}
Now it worked flawlessly.... but then we soldered our three point switches in. On our port 3 serial, we have pins 9 as forward position, 15 as backward postition, and the middle position is grounded on pin 12. On our port 4 switch, we have forward as pin 5, backward as pin 8, and middle grounded with pin 12... or 4.... they are both grounds.. not sure which one though. Anyway....

pins 9 and 15 are names p3_sw_aux1 and p3_sw_aux2 correct? And pins 5 and 8 are called p4_sw_trig and p4_sw_top, correct?

So we replaced the code with this:

Code:
if (p3_sw_aux1 == 1)
{
pwm06 = 0;
}
if(p3_sw_aux2 == 1)
{
pwm06 = 254;
}
if((p3_sw_aux1 == 0) && (p3_sw_aux2 == 0))
{
pwm06 = 127;
}
and ...

Code:
if (p4_sw_trig == 1)
{
pwm07 = 0;
}
if(p4_sw_top == 1)
{
pwm07 = 254;
}
if((p4_sw_trig == 0) && (p4_sw_top == 0))
{
pwm07 = 127;
}

The problem is.... it does not move at all when we start it up. I've been messing around with this code for a while now and can't get the motors spinning. I know for sure the Victor is wired correctly because I put in the code:

pwm07 = 0;

and it spun fine. Is the code correct still? Or did we wire it wrong? Is the ground not wired correctly? Any suggestions are helpful. This is pretty much our last day to work on this soooo anything would help.

Thanks in Advance,
Idaman323
__________________
TEAM 1706
2007 Judges Award, St. Louis (For our amazing ability to have bad luck)
2005 Rookie Inspiration Award, St. Louis
  #2   Spotlight this post!  
Unread 20-02-2006, 08:04
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Switches? Programming? Help? :)

The pinouts for the OI can be found here. The pins for aux1 and aux2 are 10 and 14, not 9 an 15, and the pins for top and trig are 7 and 2, not 5 and 8.
__________________
  #3   Spotlight this post!  
Unread 20-02-2006, 10:57
Idaman323 Idaman323 is offline
In Theory, Our Robot Would Own.
FRC #1706
Team Role: Driver
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Wentzville, MO
Posts: 116
Idaman323 is an unknown quantity at this point
Re: Switches? Programming? Help? :)

OH, well looking at talble 4.3.2, the table says p3_sw_aux1 and 2 are those pins. Maybe that means something else.... okay well thanks, I will try that today when I get to the "shop".

Thank you!

ps. that guide can be confusing...

Idaman323
__________________
TEAM 1706
2007 Judges Award, St. Louis (For our amazing ability to have bad luck)
2005 Rookie Inspiration Award, St. Louis
  #4   Spotlight this post!  
Unread 20-02-2006, 11:14
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Switches? Programming? Help? :)

Quote:
Originally Posted by Idaman323
pins 9 and 15 are names p3_sw_aux1 and p3_sw_aux2 correct? And pins 5 and 8 are called p4_sw_trig and p4_sw_top, correct?
Not correct.

You're getting confused by the fact that ports 2 and 4 each have four extra inputs that are detected as if they were different inputs on ports 3 and 1. Pins 9 and 15 on the port 2 connector are p3_sw_aux1 and p3_sw_aux2.

The inputs you want to use are pins 2, 7, 10, and 14. Unless you can explain exactly why you need to be doing something unusual, don't use the extra inputs on pins 5, 8, 9, and 15. Especially since those pins are LED outputs on ports 1 and 3.
  #5   Spotlight this post!  
Unread 20-02-2006, 11:35
Idaman323 Idaman323 is offline
In Theory, Our Robot Would Own.
FRC #1706
Team Role: Driver
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Wentzville, MO
Posts: 116
Idaman323 is an unknown quantity at this point
Re: Switches? Programming? Help? :)

Okay, i just got confused because I was using port 3 and the variables I saw on the 4.3.2 table were those pins. So when we resolder this stuff, will we still be calling it p3_sw_aux1 and 2 or p2_sw_aux1 and 2.

Im guessing it will be p3 but ya never know...
__________________
TEAM 1706
2007 Judges Award, St. Louis (For our amazing ability to have bad luck)
2005 Rookie Inspiration Award, St. Louis
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
Programming Vex w/ MPLab dababyjebus FIRST Tech Challenge 27 25-04-2008 09:11
Programming - Getting Started Mark McLeod Programming 80 16-04-2008 23:37
Programming Forum Warning Brandon Martus Announcements 10 29-12-2005 13:32
Alternative to limit switches? RbtGal1351 Electrical 27 10-12-2005 15:30
Robot Programming Education phrontist Programming 11 03-05-2004 07:32


All times are GMT -5. The time now is 01:33.

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