Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Robotix Tutorial
Working of DC Motor
Need of L293D:
1. Current can’t be drawn directly from parallel port of CPU as
current rating of Motherboard is much lesser than that of motor.
Input Output
0 0V
1 Vcc
Now, If we supply ip1 = 1(high), ip2 = 0(low), ip3 = 0(low), ip4 = 1(low)
PORTID is 0x378
Example:
#include<iostream.h>
#include<dos.h>
#include<conio.h>
void main()
{
clrscr();
char x;
while(1) /* infinite loop*/
{
x=getchar();
sleep(1) ; /* say T1 */
switch(x)
{
case w:
outportb(0x378,0x19); /*Forward ; 0x19 = 00011001*/
sleep(2); /* say T2*/
break;
}
}
}
V
Vcc
0
t
T1
T2
T1 & T2 are two delays. T2/T1 ratio controls the speed of the
motor. For maximum speed make T1 = 0;