Hey my daughter and I are messing around, trying to teach her the basics of IoT. We tapped up some code to increment a counter and display it and also reset the counter. In the code for printing we did lcd.print(0,0,"Counter =" + counter);
It started printing my SSID, password, Blynk version etc. Can someone tell me why it does this? Full code below.
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#ifndef STASSID
#define STASSID "8888888888888"
#define STAPSK "***********"
#endif
int counter = 0;
const char* ssid = STASSID;
const char* password = STAPSK;
char auth[] = "***********";
#define onboardLED D4
WidgetLCD lcd (V0);
void setup() {
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
delay(5000);
ESP.restart();
}
ArduinoOTA.setHostname("sab");
Blynk.begin(auth,STASSID,STAPSK);
ArduinoOTA.begin();
lcd.clear();
lcd.print(0,0, "sab started");
Blynk.syncAll();
pinMode(onboardLED,OUTPUT);
}
void loop() {
ArduinoOTA.handle();
Blynk.run();
}
BLYNK_WRITE(V1){
if (param.asInt()==1) {
lcd.clear();
}
}
BLYNK_WRITE (V2){
if (param.asInt()==1){
lcd.clear();
counter+=2;
lcd.print(0,0,"Counter =" + counter);
}
}