ya thanks for replying and i am interfacing with 8051 .......
i am using this circuit only.......sir
but i can't control that motor speed and i don't know how?
can anyone please tell me where can i refer for that.........
- - - Updated - - -
#include<reg51.h>
sbit sw1=P3^2;
sbit sw2=P3^3;
sbit L293D_A = P2^0; //Make positive of motor 1
sbit L293D_B = P2^1; //Make negative of motor 0
sbit L293D_E = P2^2; //Enable L293D
void rotate_f(void); //Forward run funtion
void rotate_b(void); //Backward run function
void breaks(void); //Motor stop function
void delay(void); //Some delay
void main(){
P3=0xFF;
P2=0x00;
//Our main function
while(1){ //Infinite loop
if(sw1==1 && sw2==0)
{
rotate_f(); //Run forward
delay(); //Some delay
breaks(); //Stop
delay(); //Some delay
}
if(sw2==1 && sw1==0)
{
rotate_b(); //Run Backwards
delay(); //Some delay
breaks(); //Stop
delay(); //Some delay
} //Do this infinitely
}
}
in the above program is correct or i don't know sir ok in this program i am using external interrupt int0 and int1 but it is not working correctly what will be the problem ....if i give interrupt also its not working