Question: Explain What the following code does. #include #define LED 1 ( 0 x 0 1 ) #define LED 2 ( 0 x 0 1 )
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;
PDIR LED;
POUT & ~ LED;
PDIR LED;
POUT & ~ LED;
PDIR & ~S;
PREN S;
POUT S;
PDIR & ~S;
PREN S;
POUT S;
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
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
