View Single Post
  #5   Spotlight this post!  
Unread 06-02-2015, 08:50
mshafer1 mshafer1 is offline
Programming Mentor
AKA: Matthew Shafer
FRC #3937 (Breakaway)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2008
Location: Arkansas
Posts: 53
mshafer1 is an unknown quantity at this point
Re: Can we use this magnetic sensor?

Quote:
Originally Posted by Alan Anderson View Post
It is a simple switch. It requires no power.
This is correct. To add to what Alan said, this would make the switch be active low (i.e. the dio will read false when the switch closes), to make it active high you would connect it to 5v, but because the switch would cause a short circuit in that case you would have to put a resistor in series with it.

In short:
Ground - Switch - Input(on DIO) → active low
5v - switch - resistor (like 3.3k or bigger, but not too big) - input → active high

The first option is simpler, and it is easy to account for in software.
Reply With Quote