|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Limit Switch Basics
How do you program limit switches?
|
|
#2
|
||||
|
||||
|
Re: Limit Switch Basics
Quote:
|
|
#3
|
||||
|
||||
|
Re: Limit Switch Basics
Quote:
|
|
#4
|
||||
|
||||
|
Re: Limit Switch Basics
JWS,
When the switch is closed, you will read a 0 and then the switch is open, you will read a 1... Code:
if (rc_dig_in15 == 0)
{
// This will execute when the signal on input 15 is grounded.
}
else
{
// This will execute otherwise (when the switch is open).
}
Does this make sense? Mike |
|
#5
|
||||
|
||||
|
Re: Limit Switch Basics
Yes Thanks very much!
|
|
#6
|
||||
|
||||
|
Re: Limit Switch Basics
#define leftLS rc_dig_in15
#define rightLS rc_dig_in14 if(leftLS == 0) //the left limit switch is on //dont turn left any more if(rightLS == 0) //the right limit switch is on // dont turn right any more //this post made more since before the nevermind |
|
#7
|
||||
|
||||
|
Re: Limit Switch Basics
Thanks anyway!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Limit switch in easy c? | chadbarbe | Programming | 6 | 02-02-2006 09:51 |
| How do you wire a limit switch? | JMH | Electrical | 1 | 16-02-2005 17:44 |
| gyro/accelecometer/limit switch help needed | Anton | Programming | 4 | 04-02-2005 16:39 |
| sample limit switch code??? | tml240 | Programming | 5 | 17-02-2004 17:13 |
| Controlling Arm travel - Limit Switch or Mechanical Stop? | archiver | 2001 | 8 | 23-06-2002 23:55 |