Assembly & C Program For Servo Motor With 8051
Assembly & C Program For Servo Motor With 8051
Assembly & C Program For Servo Motor With 8051
END
----------
another program
ORG 00H //Start the program
MAIN:
MOV TMOD, #01H ;using Timer 0 in Mode 1
LCALL zero_degrees ;Function to move to position = 0 deg
LCALL delay ;Function to create a delay of 1 sec
-----------------
C program to interface servo motor with 8051
#include<reg52.h>
#include<stdio.h>
#include <intrins.h>
delay(1000);
//Rotate to 90 degree
servo_pin=1;
servo_delay(82);
servo_pin=0;
delay(1000);
//Rotate to 180 degree
servo_pin=1;
servo_delay(110);
servo_pin=0;
delay(1000);
}while(1);
}