syedzeyad
Newbie level 6
- Joined
- Nov 11, 2012
- Messages
- 11
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Karachi, Pakistan, Pakistan
- Activity points
- 1,373
how can i read a reed switch and a push button switch at the same time
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Vcc
|
|
|
---
| |
| |R1
| |
---
|
|-------- Analog Input
|
---------
| |
--- ---
| | | |
| |R2 | |R3
| | | |
--- ---
| |
| |
| |
\ Sw1 |- Button
| |
| |
| |
----- -----
--- ---
- -
TRISB1 = 1;
TRISB2 = 1;
if( (RB1>0) && (RB2>0) ) {
//do something
}
Hi,
You can enable the interrupts for the both the pins, when ever change occurred it automatically capture that information.
If that pins are connected to the single port, you can read that port & could perform some bit wise operation to get the result.