Question: Question at position 2 2 Explain What the following code does. #include #define LED 1 ( 0 x 0 1 ) #define LED 2 (
Question at position Explain What the following code does. #include #define LEDx #define LEDx #define Sx #define Sx void mainvoid volatile int OUTLED ~LED LED ~LED ~LED LED LED ~LED; volatile int OUT~LED LED LED ~LED LED LED ~LED LED; volatile int TIME; PMCTL & ~LOCKLPM; WDTCTL WDTPW WDTHOLD; stop Watch Dog Timer PDIR LED; P directiLED for output POUT & ~ LED; turn off LED PDIR LED; P directiLED for output POUT & ~ LED; turn off LED PDIR & ~S; S pin P set zero for input PREN S; enable P internal resistor POUT S; enable P resistors for pullup PDIR & ~S; S pin P set zero for input PREN S; enable P internal resistor POUT S; enable P resistors for pullup volatile unsigned int i; volatile unsigned int j; volatile unsigned int k; for ;; POUT & ~LED; POUT & ~LED; ifS & PIN while S & PIN fori; i; i if OUTi LED POUT OUTi; else if OUTi ~LED POUT & OUTi; if OUTi LED POUT OUTi; else if OUTi ~LED POUT & OUTi; forj; j #define LEDx #define LEDx #define Sx #define Sx void mainvoid volatile int OUTLED ~LED LED ~LED ~LED LED LED ~LED; volatile int OUT~LED LED LED ~LED LED LED ~LED LED; volatile int TIME; PMCTL & ~LOCKLPM; WDTCTL WDTPW WDTHOLD; stop Watch Dog Timer PDIR LED; P directiLED for output POUT & ~ LED; turn off LED PDIR LED; P directiLED for output POUT & ~ LED; turn off LED PDIR & ~S; S pin P set zero for input PREN S; enable P internal resistor POUT S; enable P resistors for pullup PDIR & ~S; S pin P set zero for input PREN S; enable P internal resistor POUT S; enable P resistors for pullup volatile unsigned int i; volatile unsigned int j; volatile unsigned int k; for ;;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
