NodeMCU - ESP8266 Robot with Stand Alone Library

answer this question.
take look at

try this simple code

#define BLYNK_PRINT Serial 
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "your Auth token"; 
//motor A on D1 & D2
//motor B on D3 & D4
//joystick widget V1
void forward()
{
  digitalWrite(5, HIGH);
  digitalWrite(4,LOW);
  digitalWrite(0,HIGH);
  digitalWrite(2,LOW);
}

void backward()
{
  digitalWrite(5, LOW);
  digitalWrite(4,HIGH);
  digitalWrite(0,LOW);
  digitalWrite(2,HIGH);
}

void right()
{
  digitalWrite(5, HIGH);
  digitalWrite(4,LOW);
  digitalWrite(0,LOW);
  digitalWrite(2,LOW);
}

void left()
{
  digitalWrite(5, LOW);
  digitalWrite(4,LOW);
  digitalWrite(0,HIGH);
  digitalWrite(2,LOW);
}

void Stop()
{
  digitalWrite(5, LOW);
  digitalWrite(4,LOW);
  digitalWrite(0,LOW);
  digitalWrite(2,LOW);
}
void setup()
{
Serial.begin(115200);
  Blynk.begin(auth, "AndroidAP", "sg87654321");
  while (Blynk.connect() == false) {
    // Wait until connected
  }
  pinMode(5, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(0, OUTPUT);
  pinMode(2, OUTPUT);
}

BLYNK_WRITE(V1) 
{
  int x = param[0].asInt();
  int y = param[1].asInt();

  // Do something with x and y
/*  Serial.print("X = ");
  Serial.print(x);
  Serial.print("; Y = ");
  Serial.println(y);*/
  if(y>220)
  forward();
  else if(y<35)
  backward();
  else if(x>220)
  right();
  else if(x<35)
  left();
  else
  Stop();
}

void loop()
{
  Blynk.run();
}

motor A on D1 & D2
motor B on D3 & D4
joystick widget V1

Definitely yes… The board goes up at 2V input. Tested!

Which board?

@mikekgr, the L298N board

I have done a little test at the IN1 to know the minimum voltage to obtain high level at OUT1.
At 2.0 V the motor started to move.

That is fine! Thanks @psoro
Where can I buy this board?

C’mon @mikekgr! Are you newbie or what?? :wink:

For example, Aliexpress…check here

Hello @psoro no I am not…
Thanks anyway

@mikekgr, don’t get me wrong…I was kidding you!
:slight_smile:

Regards

1 Like

I really like this.
Could you please send me some connection diagrams and images for this program, so that I can understand very well.

First, Welcome to the Blynk forum. Please make note of the TimeDate stamps before posting, this topic is over a year and half old, and contains multiple projects.

Just read through everything here, then do some searching in the rest of the forum, and you will have more than enough to learn from :wink:

PS don’t forget to check out the Docs, Help Center and Sketch Builder… all these links are at the top right of this page.

1 Like