Author Topic: reed switch and uses  (Read 1112 times)

0 Members and 1 Guest are viewing this topic.

Offline gatoulisssTopic starter

  • Contributor
  • Posts: 30
reed switch and uses
« on: February 07, 2015, 03:45:50 pm »
hello guys, i want to use a reed switch like an on/off switch but also as selector.
i have connected it in a pull up resistor and to a pic16f88 port.  the use  i want to make for example is 3sec the magnet to the switch then system on if i release and put the magnet again for 3 sec there then it is becoming off, but if i dont release then after 4 sec (3-on+1) then is selecting mode A, 5 sec (3-on+2) then is selecting mode B and 6 sec (3-on+3) then is selecting mode C till i release. in the system program im checking a sensor and is in 4 mode silent (on state) 15sec ring (mode A) 30sec ring (mode B) and last 60 sec ring (mode C)
i have problem in ho to use the on-off and the mode selector code... any help with it?
 

Offline jmsc_02

  • Regular Contributor
  • *
  • Posts: 63
  • Country: es
Re: reed switch and uses
« Reply #1 on: February 08, 2015, 04:05:03 pm »
Can you post the code? Are you using a software debounce for the pulse of the reed?

A Finite State Machine with a timer can solve your problem very efficiently.

By the way, have you consider a hall effect transducer like A1190 in place of the reed?
i am doing a great effort to get my english plugin up and running, but it has its bugs and "zero days" fails so please, help me to improve it!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf