I have two NodeMCU, one using the normal NodeMcu and an analog sensor, the other is identical to the above but I try to use the NodeMCU API (Code below) When I connect the one with API, it disconnects the normal NodeMcu, any reason why?
Code:
//**************Declare your variables here******************* int sensorPin = 4; // ESP 12E pin D2 int sensorValue = 0; // variable to store the value coming from the sensor //**************************************************************** void HSSetup() { //************************ //Add YOUR SETUP HERE; //************************ pinMode(sensorPin, INPUT); } void HSloop() { //************************ //Add YOUR CODE HERE; //************************ /*Execute regardless of connection status*/ if (IsConnected == true) { /*Execute ONLY when HomeSeer is connected*/ // read the input on analog pin 4: // analog reading (which goes from 0 - 1023) sensorValue = analogRead(sensorPin); SendToHS(1,sensorValue); } } // end of 'if (IsConnected == true) {'
Comment