nawfaldo
Published © GPL3+

Servo with Blynk

Do you want to make servo with blynk but doesn't know how to make it? well i'll help you with that

BeginnerProtip1 hour306
Servo with Blynk

Things used in this project

Hardware components

SG90 Micro-servo motor
SG90 Micro-servo motor
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

Story

Read more

Code

Untitled file

C/C++
#define BLYNK_PRINT Serial 
//Definisi Serial pada Blink 

//Setting Library 
#include <ESP8266WiFi.h> 
#include <BlynkSimpleEsp8266.h> 
#include <Servo.h> 

//Definisi variabel token, SSID, password 
char auth[] = "***************************"; 
char ssid[] = "belajar"; 
char pass[] = "00223344"; 

//Definisi fungsi servo menjadi gerak_servo 
Servo gerak_servo; 

//Fungsi Blynk untuk mengatur nilai servo dengan pin virtual V1 
BLYNK_WRITE(V1){ 
  gerak_servo.write(param.asInt()); 
}

//Settingan awal default 
void setup(){ 
 Serial.begin(9600);
 //memulai serial monitor dengan baudrate 9600 
  
 gerak_servo.attach(2); 
 //setting pin gpio 2 ke servo 
  
 Blynk.begin(auth, ssid, pass); 
 //setting blynk 
} 
void loop(){ 
  Blynk.run(); 
  //memulai blynk 
}

Credits

nawfaldo
9 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.