void dc(int p)
{
switch(p)
{
case 0: //停转
{P1OUT &=~ BIT0; P1OUT &=~ BIT6; P1OUT &=~ BIT7; __delay_cycles(160000); break; }
case 1: //正转
{P1OUT |= BIT0; P1OUT |= BIT6; P1OUT &=~ BIT7; __delay_cycles(160000); break; }
case 2: //反转
{P1OUT |= BIT0; P1OUT &=~ BIT6; P1OUT |= BIT7; __delay_cycles(160000); break;}
}
}
|