View Single Post
  #6   Spotlight this post!  
Unread 21-04-2004, 14:53
Marc P. Marc P. is offline
I fix stuff.
AKA: βetamarc
no team
 
Join Date: Jan 2002
Rookie Year: 1999
Location: Watertown, CT
Posts: 997
Marc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond reputeMarc P. has a reputation beyond repute
Send a message via AIM to Marc P.
Re: Limit Switches help.

What it looks like the original poster wants to do is limit the motion of a motor based on whether a limit switch is active.

It looks like you want the motor to go only in reverse (less than 127) when that switch is active. I'm not too good with C, but in pbasic, you'd use the MAX and MIN declarations, e.g.

p1_y = p1_y MAX 127 MIN 0

I'm not sure if there is an equivalent in C, or how it would be implemented, but I think that's what you'd be looking for- to set that condition when the switch is enabled.