Is there an issue with the code preventing serial monitoring ? I need to adjust the digital write values on the moisture sensors however with out the serial monitoring it's been a cumbersome task.
I appreciate any feedback or help.
Thanks!
/****************************************
Define Constants
****************************************/
#define sensor A0 // Hook water sensor to pin A0 of NODEMCU module
#define LED D2 // Led signals to relay that illuminates strobe LED
/****************************************
Auxiliar Functions
****************************************/
void callback(char* topic, byte* payload, unsigned int length) {
Serial.print("Message arrived [");
Serial.print(topic);
Serial.print("] ");
for (int i = 0; i < length; i++) {
Serial.print((char)payload[i]);
}
Serial.println();
}
/****************************************
Main Functions
****************************************/
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(sensor, INPUT); // Analog pin setup for read
pinMode(LED, OUTPUT); // LED pin as output for strobe LED circuit
}
void loop() {
float adcValue = analogRead(sensor); // Read the ADC channel
//adjust adcValue so LED illuminates as needed.
if (adcValue > 400){
digitalWrite(LED, HIGH);
}
if (adcValue < 200){
digitalWrite(LED, LOW);
}
}
/****************************************
Define Constants / #define sensor A0 // Hook water sensor to pin A0 of NODEMCU module #define LED D2 // Led signals to relay that illuminates strobe LED
/
Auxiliar Functions
****************************************/
void callback(char* topic, byte* payload, unsigned int length) {
Serial.print("Message arrived [");
Serial.print(topic);
Serial.print("] ");
for (int i = 0; i < length; i++) {
Serial.print((char)payload[i]);
}
Serial.println();
}
/****************************************
Main Functions
****************************************/
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(sensor, INPUT); // Analog pin setup for read
pinMode(LED, OUTPUT); // LED pin as output for strobe LED circuit
}
void loop() {
float adcValue = analogRead(sensor); // Read the ADC channel
//adjust adcValue so LED illuminates as needed.
if (adcValue > 400){
digitalWrite(LED, HIGH);
}
if (adcValue < 200){
digitalWrite(LED, LOW);
}