hi, i want to make smart cat feeder with blynk.
i know example which given by blynk, but it’s working with slider.
i used arduino UNO borad and sparkfun esp8266 wifi shield
i found some codes, but it used nodemcu, so it has different code.
this is my code, it works with slider.
#include <Blynk.h>
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <Servo.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "###";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "###";
char pass[] = "###";
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(8, 9); // RX, TX
// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&EspSerial);
Servo servo;
#define SERVO 5
void setup()
{
// Set console baud rate
Serial.begin(9600);
delay(10);
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
servo.attach(SERVO);
Blynk.begin(auth, wifi, ssid, pass);
}
void loop()
{
Blynk.run();
}
BLYNK_WRITE(V1)
{
servo.write(param.asInt());
}
please help. i don’t know how to edit it to work with button.
i want to servo motor turns 30degree for 1 seconds and back to 0 degree again.