Servo Motor Control using by Mobile
👨🏻💻 Code :-
/*
code started
#define servo= 11;
#define rx= 2;
#define tx= 3;
code created by technical idEas
https://youtube.com/c/TechnicalidEas07
*/
#include<SoftwareSerial.h>
#include <Servo.h>
Servo myservo;
SoftwareSerial mySerial(2, 3); // RX, TX
int Position ;
void setup()
{
myservo.attach(11);
mySerial.begin(9600);
Serial.begin(9600);
}
void loop()
{
if(mySerial.available()>0)
{
Position = mySerial.read();
Position = map(Position, 0, 180, 180, 0);
myservo.write(Position);
}
}
Instagram ID :- https://www.instagram.com/technical_ideas_07/
APPLICATION :- https://drive.google.com/file/d/1AQJ29gRVOFhm1Ap1BkEbRWKg_pvEbvAX/view?usp=drivesdk
SUBSCRIBE NOW :- https://youtube.com/channel/UCCJyR_wnt3SxhErsSUP9Wrw 🥺
Thx bro, it is working;)
ReplyDeleteHi could you share how you connected the servo motor wires thanks
ReplyDeletehi
ReplyDeleteGreat
ReplyDeleteBRO NOT WORKING
ReplyDeleteMAN