Please help.
How to display value from serial.println of the code to the blynk.
This is my code
#define A 22
#define B 23
#define C 24
#define D 25
int counter = 0;
int diam;
int akhir;
void setup() {
pinMode(A, INPUT);
pinMode(B, INPUT);
pinMode(C, OUTPUT);
pinMode(D, OUTPUT);
Serial.begin(9600);
akhir=digitalRead(A);}
void loop() {
diam=digitalRead(A);
if (diam!=akhir){
if(digitalRead(B)!=diam){
counter ++;
}else{
counter --;}
Serial.print("Posisi : ");
Serial.println(counter);}
int sensorValue = analogRead(A14);
float volt = sensorValue*(5.00/1023.00);
Serial.println (volt);
if (volt>=4.01){
digitalWrite(C, HIGH);}
else if (volt <=3.82){
digitalWrite(D,HIGH);}
else {digitalWrite(C,LOW); digitalWrite(D,LOW);}
delay(1);
akhir=diam;}
This is my hardware.
-Arduino mega + esp8266
-Androi pie
-blynk
I want to display the value of serial.println (counter) and serial.println (volt) to blynk.
I have searched I just found the dht11 which use library to read the sensor.