Pasos unipolar a transistores


void main()
{
 osccon = 0x77;   //reloj interno a 8Mhz
 portD = 0x00;    //inicia puertoD
 TrisD = 0x00;    //el puertoD son salidas
 while(1)         //ciclo infinito
 {
  portD.f0=1;     //manda 1 a RD0
  delay_ms(200);  //retarda 200ms
  portD.f0=0;     //manda 0 a RD0
  portD.f1=1;     //manda 1 a RD1
  delay_ms(200);  //retarda 200ms
  portD.f1=0;     //manda 0 a RD1
  portD.f2=1;     //manda 1 a RD2
  delay_ms(200);  //retarda 200ms
  portD.f2=0;     //manda 0 a RD2
  portD.f3=1;     //manda 1 a RD3
  delay_ms(200);  //retarda 200ms
  portD.f3=0;     //manda 0 a RD0
  }
}



Comentarios