i am working with nodeMCU and L9110 control motor and servo and I have some problem.
I can control servo but motor is not run.
this is my code:
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Servo.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "pZ7qh-H0TfMW12UB99XkvcsezkbY_I3n";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Nhat Duong";
char pass[] = "23456789";
// connect motor controller pins to Arduino digital pins
// motor
Servo servo1;
BLYNK_WRITE(V1) {
int y = param[1].asInt();
// Do something with y
{
servo1.write(param[1].asInt());
}
}
BLYNK_WRITE(V2) {
int pinValue = param[2].asInt();
{
digitalWrite(4,param[2].asInt());}
}
BLYNK_WRITE(V3) {
int pinValue = param[3].asInt();
{
digitalWrite(5,param[3].asInt());}
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
servo1.attach(15);
}
void loop()
{
Blynk.run();
}