STEP #4 : calibration of the servo

arduino4fun
Site Admin
Posts: 37
Joined: Mon Jun 06, 2016 1:16 pm

STEP #4 : calibration of the servo

Postby arduino4fun » Thu Jun 09, 2016 7:40 am

calibration of the servo (ie: to put it at the right position on the support), the servo is connected with pin 5 (pic 1); use & execute the following code to put the servo at 90 degree (pic 2); whenever it's done, un-connect the usb cable, place the servo in the axis of the support and fix it with a screw (pic 3); the servo is now correctly in place

Code: Select all

// ---------------------------------------------------------------------------------------------------------------
 // This sketch allows to put the ultrasonic servo (pin #5) in the front position before fixing it on the support
 //
 // https://www.facebook.com/arduino4fun
 // http://www.arduino4fun.com
 // ---------------------------------------------------------------------------------------------------------------

‪#‎include‬ <Servo.h>

Servo MyServo; // Define our Servo

void setup()
 {
 MyServo.attach(5); // servo on digital pin 5

MyServo.write(90); // Turn Servo Left to 90 degrees
 }

void loop()
 {
 }


Image
Image
Image

Return to “Multifunction Bluetooth Controlled Robot Smart Car Kits For Arduino”

Who is online

Users browsing this forum: No registered users and 0 guests