Hello, I am new in this and i just started learning Arduinos language to make a robot gripper but I need to know how can I program the servos. Also my project includes Wi-fi controlling and I also don
t know how to do it.
Thanks.
Hello, I am new in this and i just started learning Arduinos language to make a robot gripper but I need to know how can I program the servos. Also my project includes Wi-fi controlling and I also don
t know how to do it.
Thanks.
Simple servo test code you can use to see if you can control your servo.
//zoomkat 7-30-10 serial servo test
//type servo position 0 to 180 in serial monitor
// Powering a servo from the arduino usually *DOES NOT WORK*.
String readString;
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
Serial.begin(9600);
myservo.attach(9);
Serial.println("servo-test"); // so I can keep track of what is loaded
}
void loop() {
while (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the String readString
delay(2); //slow looping to allow buffer to fill with next character
}
if (readString.length() >0) {
Serial.println(readString); //so you can see the captured String
int n = readString.toInt(); //convert readString into a number
Serial.println(n); //so you can see the integer
myservo.write(n);
readString="";
}
}
but I need to know how can I program the servos
You can't. Servos can be controlled. Microprocessors can be programmed.
Also my project includes Wi-fi controlling and I also don`t know how to do it.
Then, you are going to have real problems completing the project.
I can't help at all on the WiFi side, and have never used a Mac in my life.
But controlling a servo is dead simple: start here and see how you get on. That should get you started, then come back with specific questions if you need to.