SlideShare a Scribd company logo
#define BLYNK_PRINT Serial
#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "c52bbc1504a2449d89667a2b320b2d47";
int pinValue;
SoftwareSerial SerialBLE(10, 11); // RX, TX
int enable=0;
int frwd=0;
int revr=0;
int spd=0;
void setup()
{
// Debug console
Serial.begin(9600);
SerialBLE.begin(9600);
Blynk.begin(SerialBLE, auth);
Serial.println("Waiting for connections...");
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
}
BLYNK_WRITE(V1)
{
pinValue = param.asInt(); // assigning incoming value from pin V1 to a
variable
// You can also use:
// String i = param.asStr();
// double d = param.asDouble();
Serial.print("V1 Slider value is: ");
Serial.println(pinValue);
}
BLYNK_WRITE(V2)
{
frwd = param.asInt(); // assigning incoming value from pin V1 to a variable
}
BLYNK_WRITE(V3)
{
revr = param.asInt(); // assigning incoming value from pin V1 to a variable
}
BLYNK_WRITE(V4)
{ enable = param.asInt(); // assigning incoming value from pin V1 to a variable
}
void loop()
{
Blynk.run();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
if(enable==1)
{
if(frwd==1 && revr==0)
{
analogWrite(5,0);
analogWrite(6,pinValue);
Serial.println("forward");
}
if(frwd==0 && revr==1)
{
analogWrite(5,pinValue);
analogWrite(6,0);
Serial.println("reverse");
}
if(frwd==0 && revr==0)
{
analogWrite(5,0);
analogWrite(6,0);
}
if(frwd==1 && revr==1)
{
analogWrite(5,0);
analogWrite(6,0);
}
}
else{
analogWrite(5,0);
analogWrite(6,0);
}
}

More Related Content

DOCX
PDF
Php arduino
PDF
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
TXT
Digital Voltmeter displaying voltage level on a seven segment display and com...
PDF
YCAM Workshop Part 3
PDF
Codemania101: The Present, Past and Future of Asynchronous Programming in Python
PDF
Rop and it's friends
PPTX
javascript function & closure
Php arduino
FrontDays #3. Иван Федяев, Эволюция JavaScript. Обзор нововведений ECMAScript 6
Digital Voltmeter displaying voltage level on a seven segment display and com...
YCAM Workshop Part 3
Codemania101: The Present, Past and Future of Asynchronous Programming in Python
Rop and it's friends
javascript function & closure

What's hot (18)

DOCX
radix_4 fft dif with mdc and mdf
PDF
Remote Command Execution
TXT
Ir remote kit_blink.pde
KEY
Unit testing en iOS @ MobileCon Galicia
DOCX
Dam gate open close lpc prog
PDF
The Ring programming language version 1.4 book - Part 21 of 30
PDF
#JavaFX.forReal() - ElsassJUG
PPTX
Random stability in systemVerilog and UVM based testbench
KEY
Your codebase sucks! and how to fix it
PPT
Reverse engineering20151112
DOCX
Network lap pgms 7th semester
PPT
Verilog Lecture3 hust 2014
PDF
Unit Testing: Special Cases
DOCX
C++ file
DOC
Network lab manual
PDF
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
PDF
Testing with Kotlin
PDF
An introduction to PHP 5.4
radix_4 fft dif with mdc and mdf
Remote Command Execution
Ir remote kit_blink.pde
Unit testing en iOS @ MobileCon Galicia
Dam gate open close lpc prog
The Ring programming language version 1.4 book - Part 21 of 30
#JavaFX.forReal() - ElsassJUG
Random stability in systemVerilog and UVM based testbench
Your codebase sucks! and how to fix it
Reverse engineering20151112
Network lap pgms 7th semester
Verilog Lecture3 hust 2014
Unit Testing: Special Cases
C++ file
Network lab manual
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Testing with Kotlin
An introduction to PHP 5.4
Ad

Similar to Program of speed and direction control of dc motor (20)

PDF
CO352 - Lab Manual - IoT with Cloud Computing Lab.pdf
PDF
Steps to be done in arduino ide for monitoring
KEY
Scottish Ruby Conference 2010 Arduino, Ruby RAD
PDF
Survey_Paper
PDF
NodeMCU with Blynk and Firebase
PDF
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
PDF
What is arduino
PPT
WIRELESS COMMUNICATIONAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
DOCX
Simply arduino
PDF
From Arduino to LinnStrument
PPTX
Scratch pcduino
DOCX
Speed and direction control of dc motor using android mobile application chan...
DOCX
Speed and direction control of dc motor using android mobile application chan...
PDF
Road to RIoT 2017 Medan
PDF
第一回 冬のスイッチ大勉強会 - XBee編 -
PDF
Documento de acrobat2
PDF
Esp8266 basics
PDF
Syed IoT - module 5
PPT
13223971.ppt
PDF
Esp8266 v12
CO352 - Lab Manual - IoT with Cloud Computing Lab.pdf
Steps to be done in arduino ide for monitoring
Scottish Ruby Conference 2010 Arduino, Ruby RAD
Survey_Paper
NodeMCU with Blynk and Firebase
Roberto Gallea: Workshop Arduino, giorno #2 Arduino + Processing
What is arduino
WIRELESS COMMUNICATIONAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Simply arduino
From Arduino to LinnStrument
Scratch pcduino
Speed and direction control of dc motor using android mobile application chan...
Speed and direction control of dc motor using android mobile application chan...
Road to RIoT 2017 Medan
第一回 冬のスイッチ大勉強会 - XBee編 -
Documento de acrobat2
Esp8266 basics
Syed IoT - module 5
13223971.ppt
Esp8266 v12
Ad

Recently uploaded (20)

PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPT
Total quality management ppt for engineering students
PPTX
communication and presentation skills 01
PDF
Design Guidelines and solutions for Plastics parts
PPTX
Management Information system : MIS-e-Business Systems.pptx
PPTX
Feature types and data preprocessing steps
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PDF
Visual Aids for Exploratory Data Analysis.pdf
PPTX
Current and future trends in Computer Vision.pptx
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PPTX
Module 8- Technological and Communication Skills.pptx
PPTX
Fundamentals of Mechanical Engineering.pptx
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
Total quality management ppt for engineering students
communication and presentation skills 01
Design Guidelines and solutions for Plastics parts
Management Information system : MIS-e-Business Systems.pptx
Feature types and data preprocessing steps
III.4.1.2_The_Space_Environment.p pdffdf
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
Visual Aids for Exploratory Data Analysis.pdf
Current and future trends in Computer Vision.pptx
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Module 8- Technological and Communication Skills.pptx
Fundamentals of Mechanical Engineering.pptx
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...

Program of speed and direction control of dc motor

  • 1. #define BLYNK_PRINT Serial #include <BlynkSimpleSerialBLE.h> #include <SoftwareSerial.h> SoftwareSerial SwSerial(10, 11); // RX, TX // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "c52bbc1504a2449d89667a2b320b2d47"; int pinValue; SoftwareSerial SerialBLE(10, 11); // RX, TX int enable=0; int frwd=0; int revr=0; int spd=0; void setup() { // Debug console Serial.begin(9600); SerialBLE.begin(9600); Blynk.begin(SerialBLE, auth); Serial.println("Waiting for connections..."); pinMode(5,OUTPUT); pinMode(6,OUTPUT); } BLYNK_WRITE(V1) { pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable // You can also use: // String i = param.asStr(); // double d = param.asDouble(); Serial.print("V1 Slider value is: "); Serial.println(pinValue); } BLYNK_WRITE(V2) { frwd = param.asInt(); // assigning incoming value from pin V1 to a variable } BLYNK_WRITE(V3) { revr = param.asInt(); // assigning incoming value from pin V1 to a variable } BLYNK_WRITE(V4) { enable = param.asInt(); // assigning incoming value from pin V1 to a variable } void loop() { Blynk.run(); // You can inject your own code or combine it with other sketches. // Check other examples on how to communicate with Blynk. Remember // to avoid delay() function! if(enable==1) { if(frwd==1 && revr==0) { analogWrite(5,0); analogWrite(6,pinValue);
  • 2. Serial.println("forward"); } if(frwd==0 && revr==1) { analogWrite(5,pinValue); analogWrite(6,0); Serial.println("reverse"); } if(frwd==0 && revr==0) { analogWrite(5,0); analogWrite(6,0); } if(frwd==1 && revr==1) { analogWrite(5,0); analogWrite(6,0); } } else{ analogWrite(5,0); analogWrite(6,0); } }