Go to Post Off time, at a regional? What is that? - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-10-2015, 20:27
Team5709 Team5709 is offline
Registered User
FRC #5709
 
Join Date: Jan 2015
Location: Michigan
Posts: 23
Team5709 is an unknown quantity at this point
Limit Switches

hello i ma a lead programmer from team 5709 the rudyard nerfherders and i was wondering how do i program limit switches to stop a motor from rotating a certain way when it is closed?

so if the elevator hits a limit switch on the bottom it will only be able to allowed to go up and not down anymore.
Reply With Quote
  #2   Spotlight this post!  
Unread 22-10-2015, 21:14
Certified Nerd's Avatar
Certified Nerd Certified Nerd is offline
The Only Certified Nerd! GOT IT?!
AKA: Danny
FRC #3840 (TNT)
Team Role: Engineer
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Harris MN
Posts: 74
Certified Nerd is an unknown quantity at this point
Re: Limit Switches

I can't answer your question, but you will need to share the programming language you are using as well as weather you are using NC or NO for the limit switch. Once this info is provided someone on here should be able to help you.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-10-2015, 21:51
Team5709 Team5709 is offline
Registered User
FRC #5709
 
Join Date: Jan 2015
Location: Michigan
Posts: 23
Team5709 is an unknown quantity at this point
Re: Limit Switches

i ma using java and i would like to know how to do it for them both
Reply With Quote
  #4   Spotlight this post!  
Unread 22-10-2015, 23:50
MaGiC_PiKaChU's Avatar
MaGiC_PiKaChU MaGiC_PiKaChU is offline
Drive Coach
AKA: Antoine L.
FRC #3360 (Hyperion)
Team Role: Mentor
 
Join Date: Mar 2014
Rookie Year: 2012
Location: Sherbrooke
Posts: 608
MaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond reputeMaGiC_PiKaChU has a reputation beyond repute
Re: Limit Switches

Hi,

The simple way to do this would be with an if statement:

Code:
double speed = getJoystickAxis();

if(limitswitch.get() && speed<0)
{
    speed=0;
}
motor.set(speed);
That makes your motor output 0 instead of a negative value when your switch is pressed, but still allows it to have a positive value
__________________
2012 - 3360 - Junior member
2013 - 3360 - Lead Programmer, Human player
2014 - 3360 - Lead Programmer, Human player
2015 - 3360 - Lead Programmer, Driver
2016 - 3360 - Mentor, Drive coach



Reply With Quote
  #5   Spotlight this post!  
Unread 23-10-2015, 00:32
ShortCircuit908's Avatar
ShortCircuit908 ShortCircuit908 is offline
King of Hacky Fixes
AKA: Caleb Milligan
FRC #4450 (Olympia Robotics Federation)
Team Role: Programmer
 
Join Date: Mar 2015
Rookie Year: 2014
Location: Olympia, WA
Posts: 7
ShortCircuit908 is an unknown quantity at this point
Re: Limit Switches

This topic has been explained more in-depth in a previous post: http://www.chiefdelphi.com/forums/sh...d.php?t=134642

You can probably find the best answer there.
Reply With Quote
Reply


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


All times are GMT -5. The time now is 11:51.

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