how to make pic and pot robot (robotic arm) in tamil





Coding For Pic and Pot

#include <Servo.h>
String servo;
String val;
int value;
Servo bottomservo;
Servo handservo1;
Servo handservo2;
Servo clipservo;
void setup() {
  Serial.begin(9600);
  bottomservo.attach(6); 
  handservo1.attach(9); 
  handservo2.attach(10); 
  clipservo.attach(11); 
  
}

void loop() {
  if (Serial.available())
  {
    servo  = Serial.readStringUntil(',');
    Serial.read(); 
    val  = Serial.readStringUntil('\0');
    value = val.toInt();
    Serial.println(servo);
  }
  if(servo == "1")
  bottomservo.write(value); 
  else if(servo == "2")
  handservo1.write(value);
  else if(servo == "3")
  handservo2.write(value);
  else if(servo == "4")
  clipservo.write(value);
}
*****************************************************************************

Comments

Popular posts from this blog

CHATBOT programming tutorial in tamil

programing part for petrol level measuring in tamil

using millis() in ultrasonic sensor program in tamil