Question: #include #define MOISTURE _ SENSOR _ PIN INCH _ 0 #define BUZZER _ PIN BIT 1 void initADC ( ) ; void initBuzzer ( )
#include
#define MOISTURESENSORPIN INCH
#define BUZZERPIN BIT
void initADC;
void initBuzzer;
void buzz;
int readMoisture;
int mainvoid
WDTCTL WDTPW WDTHOLD;
initADC;
initBuzzer;
while
int moistureLevel readMoisture;
if moistureLevel
buzz;
bisSRregisterLPMbits GIE;
void initADC
ADCCTL ADCSHT ADCON;
ADCCTL MOISTURESENSORPIN;
void initBuzzer
PDIR BUZZERPIN;
void buzz
POUT BUZZERPIN;
delaycycles;
POUT & ~BUZZERPIN;
int readMoisture
ADCCTL ENC ADCSC;
while ADCCTL & ADCBUSY;
return ADCMEM;
write the configuration of ports and peripherals for first time use:
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
