Go to Post I know it's hard to believe, but there actually IS life after FIRST. - jleibs [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 01-03-2003, 23:37
pras870's Avatar
pras870 pras870 is offline
Registered User
AKA: Mike
#0870 (Team Rice)
Team Role: Mentor
 
Join Date: Feb 2003
Location: Southold, NY
Posts: 214
pras870 can only hope to improve
Send a message via AIM to pras870
Switch with Servo

I was wondering i there was anyway to program a servo to be activated on a rocker switch instead of with a petentiometer, such as have it rotate 180 degrees or something?
  #2   Spotlight this post!  
Unread 01-03-2003, 23:44
rust710's Avatar
rust710 rust710 is offline
Registered User
#0862 (Lightning Robotics)
 
Join Date: Dec 2002
Location: Canton, MI
Posts: 103
rust710 is an unknown quantity at this point
Send a message via AIM to rust710
servo = 127
if sw1 = 1 then servo = 254
if sw2 = 1 then servo = 0
__________________
Andrew Radamis
Programmer on 862
info@lightingrobotics.com
  #3   Spotlight this post!  
Unread 01-03-2003, 23:53
pras870's Avatar
pras870 pras870 is offline
Registered User
AKA: Mike
#0870 (Team Rice)
Team Role: Mentor
 
Join Date: Feb 2003
Location: Southold, NY
Posts: 214
pras870 can only hope to improve
Send a message via AIM to pras870
you're positive this would work? i've been argueing with our programmer that it is possible.
  #4   Spotlight this post!  
Unread 02-03-2003, 00:47
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Quote:
Originally posted by rust710
servo = 127
if sw1 = 1 then servo = 254
if sw2 = 1 then servo = 0
Quote:
Originally posted by pras870
you're positive this would work? i've been argueing with our programmer that it is possible.
With this code, the servo will normally be in a centered position, and whenever the rocker switch is thrown, the servo will turn to the corresponding extreme. The servo will return to the centered position whenever the rocker switch is in its centered position.

If you would rather have the servo only go from one extreme to the other, you might want something more like this:
Code:
servo = 0

main_loop:
...
if sw1 = 1 then servo = 254
if sw2 = 1 then servo = 0
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #5   Spotlight this post!  
Unread 03-03-2003, 12:23
EricS-Team180's Avatar
EricS-Team180 EricS-Team180 is offline
SPAM, the lunchmeat of superheroes!
AKA: Eric Schreffler
FRC #0180 (SPAM)
Team Role: Engineer
 
Join Date: Apr 2002
Rookie Year: 2001
Location: Stuart, Florida
Posts: 561
EricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond reputeEricS-Team180 has a reputation beyond repute
YEP...

We used just that to activate a "brake" pin in our gearboxes last year....works fine...
__________________

Don't PANIC!
S. P. A. M.
  #6   Spotlight this post!  
Unread 03-03-2003, 13:39
JLambert's Avatar
JLambert JLambert is offline
Registered User
#0151 (Wild Cards)
 
Join Date: Jan 2003
Location: Nashua, NH
Posts: 49
JLambert is an unknown quantity at this point
Send a message via ICQ to JLambert Send a message via AIM to JLambert Send a message via Yahoo to JLambert
Quote:
Originally posted by EricS-Team180
YEP...

We used just that to activate a "brake" pin in our gearboxes last year....works fine...
Our team did the same thing two years ago, and we're doing it this year too. It works great.
__________________
Justin Lambert
02-03: Programmer Team #151
  #7   Spotlight this post!  
Unread 10-03-2003, 14:33
pras870's Avatar
pras870 pras870 is offline
Registered User
AKA: Mike
#0870 (Team Rice)
Team Role: Mentor
 
Join Date: Feb 2003
Location: Southold, NY
Posts: 214
pras870 can only hope to improve
Send a message via AIM to pras870
we're using a rocker switch. Right now the code we have is this:

p1_wheel = 0
if p3_sw_aux2 = 0 then p1_wheel = 0
if p3_sw_aux2 = 1 then p1_wheel = 63

since the servo is on PWM 9 we're using p1_wheel variable, but yusing the roboemu program, the wheel on the joystick moves the server but not aux2, any help would be appreciated.

Last edited by pras870 : 10-03-2003 at 15:55.
  #8   Spotlight this post!  
Unread 10-03-2003, 17:33
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Quote:
Originally posted by pras870
we're using a rocker switch. Right now the code we have is this:

p1_wheel = 0
if p3_sw_aux2 = 0 then p1_wheel = 0
if p3_sw_aux2 = 1 then p1_wheel = 63

since the servo is on PWM 9 we're using p1_wheel variable, but yusing the roboemu program, the wheel on the joystick moves the server but not aux2, any help would be appreciated.

If you email me your code, I'd be happy to take a look. RoboEmu doesn't currently have any known issues that would affect code like the stuff you posted, so it's probably a line somewhere farther down overriding your code. Anyways, let me know. rob-bayer@mn.rr.com
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #9   Spotlight this post!  
Unread 11-03-2003, 09:56
pras870's Avatar
pras870 pras870 is offline
Registered User
AKA: Mike
#0870 (Team Rice)
Team Role: Mentor
 
Join Date: Feb 2003
Location: Southold, NY
Posts: 214
pras870 can only hope to improve
Send a message via AIM to pras870
I also found out today that any wheel on a joystick controls p1_wheel, it's strange if you ask me.
  #10   Spotlight this post!  
Unread 12-03-2003, 02:53
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Quote:
Originally posted by pras870
I also found out today that any wheel on a joystick controls p1_wheel, it's strange if you ask me.
Pras,

There's just not enough info to go on here. I suggest you do as Rob suggests, and send him your code. Better yet, post it here, and you can have a bunch more pair of eyes looking at it at the same time.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
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
spike for pressure switch? Rob Colatutto Rules/Strategy 4 23-02-2003 15:42
Using a switch before autonomous operation KZos550 Programming 11 04-02-2003 19:12
NEED HELP with Delay loop for compressor relay switch archiver 2001 10 24-06-2002 02:11
Changing gears archiver 2000 1 23-06-2002 23:26
Error found in programming for the pump and pressure switch sjharobotics Programming 4 06-02-2002 17:46


All times are GMT -5. The time now is 22:26.

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