1.Tujuan [kembali]
Mempelajari cara pengaplikasian MCS51 pada Motor DC
2. Alat [kembali]
*80C51
*L293D
*MOTOR DC
*SWITCH
3.Teori [kembali]
4.Rangkaian [kembali]
5.Program [kembali]
#include <REGX51.H> //library 8051
sbit motor1=P1^0;
sbit motor2=P1^1;
void msdelay (unsigned int) ;
void msdelay (unsigned int value){
unsigned int x, y;
for (x=0; x<value; x++)
for (y=0; y<1275; y++);
}
void main(void){
motor1=0xff;
motor2=0xff;
while (1){
if (motor1==1)
{P2=0x05;
}
else if (motor2==1)
{P2=0x0a;
}
else if (motor1==1 && motor2==1)
{P2=0x00;}
}
}





Tidak ada komentar:
Posting Komentar