Search the Community
Showing results for tags 'button'.
-
I've been working on a project for MSP-EXP430G2 which requires two buttons and hit the problem that S1 is set up as a reset button. Unlike S2 it's not connected to a regular GPIO pin; instead it's connected to the nRST/NMI pin. I looked for information on using the reset button as a user input and found some examples, but they all used the NMI ISR to track rising and falling edges. For example, see this post from the 43oh blog: Using the MSP430G2xx1 nRST NMI Pin as an Input. I really wanted some way to sample the current state of the button directly, which is tricky because there's n
-
Hi Everybody; I am newbei about C200O programming with CodeComposerStudio. I tried simple code which is led blinking. But I want to use button. And I can't run it. Anyway I attached code and screenshot. What's wrong my code? GPIO_setMode(myGpio, GPIO_Number_12, GPIO_12_Mode_GeneralPurpose); GPIO_setDirection(myGpio, GPIO_Number_12, GPIO_Direction_Input ); int state = GPIO_getData(myGpio, GPIO_Number_12); GPIO_setLow(myGpio, GPIO_Number_0); GPIO_setLow(myGpio, GPIO_Number_1); GPIO_setLow(myGpio, GPIO_Number_2); GPIO_setLow(myGpio, GPIO_Number_3); while(1) { if(
-
Hi everyone, it is probably a very stupid question. But i'm simply trying to toggle a LED(P1.0) by using the button S2(P1.1) which is on the launch pad of FR5969. but it is not wotking at all... #include <msp430.h> void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1DIR |= 0x01; // Set P1.0 to output direction P1REN = 0x02; ? P1OUT= 0x02; ? P1IE |= 0x02; // P1.1 interrupt enabled P1IES |= 0x02; // P1.1 Hi/lo edge P1IFG &= ~0x02; // P1.1 IFG cleared _BIS_SR(LPM3_bits + GIE); // Enter LPM4 w/interrupt } // Port 1 interrupt service routine #pragma