Below is code used to increment and decrement an LED counterusing a switch (S1) on the MSP432 P1.1 toincrement; and (S2) externally connected to P5.0 andP5.2 to decrement the led.
However, when pressing the increment button, it only works if S2is also pressed at the same time. What might be the problem here?Need help fixing this code or outlining any issues. THANK YOU!
#include “msp.h”
// Global variable used to hold the current state
char currentState;
// Global variable used to hold the number of pushes
long int pushes;
void countDown(void);
void countUp(void);
/*
* Initialization function runs once before the state machinewhile(1) loop.
*/
void init(void)
{
WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; //
PayPal Gateway not configured
PayPal Gateway not configured