Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
About the reed switch: You're right, you'd have some difficulty making the reed switch a drop-in replacement for a pushbutton switch. What you can do instead would be to have a microcontroller output connected to the pushbutton lines, and then have the reed switch as an input, you can XOR in software. Lastly, I don't know if a reed switch has the sensitivity to have some range, so you may have to put them in the almost-touching range.
int prevState = 0;int state = 0...(inside your loop)prevState = state;state = // read the pinif (state != prevState && state) // if the state has changed AND state is TRUE // set output pin high, as this is the reed switch's first HIGHelse if (state) // prevState == state, and state is TRUE, eed must have already been pressed // set output pin low// do other stuff, like light up leds or print out to LCD.
Basically it will consist of two objects(Object-1 and Object-2), when they are put right next to each other, there will be an audio playback and when they are separated the audio should stop.
Okay the recording module will be located inside Object-1. The module has a push switch/button for playback & stop. What I plan on doing(this is where I'm probably wrong and I need some advice!) is remove the switch/button and replace is with a Reed Switch like this one:[Snip]Then inside Object-2 will be a magnet that will activate the Reed Switch inside Object-1 and play the audio. At least thats what I want it to do, but I have a feeling it is more complicated than just replacing the switch.I think this might not work since the original switch works with just one push i guess, and the reed switch is something that will be 'open' or 'ON' the entire time the two objects are placed next to each other??