Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 218536

Forum Post: RE: MSP-EXP430FR4133 Button S2

$
0
0
Sammy, when using buttons, the OUT-register is used in combination with the REN-register to set a pull-up/down-resistor. Can you show your complete code? S1 is on P1.2, S2 on P2.6 - both have no external resistor, so they both need a software set one inside the microcontroller. Since both switches short the pin to GND, you will use a pull-up resistor by setting P1OUT |= 0x04; // P1.2 resistor pulls-up P1REN |= 0x04; // P1.2 enable resistor and P2OUT |= 0x40; // P2.6 resistor pulls-up P2REN |= 0x40; // P2.6 enable resistor Dennis

Viewing all articles
Browse latest Browse all 218536

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>