Skip to content

Instantly share code, notes, and snippets.

@everblut
Created May 22, 2012 15:32
Show Gist options
  • Save everblut/2769781 to your computer and use it in GitHub Desktop.
Save everblut/2769781 to your computer and use it in GitHub Desktop.
PIC
#include <16F628A.h> //Pic a utilizar
#FUSES NOWDT //No usar el watchdog
#FUSES INTRC_IO //Usar el cristal interno, sin CLKOUT
#FUSES BROWNOUT //activa el brownout
#use delay(clock=4000000) // frecuencia de 4Mhz
void main( void ){
set_tris_b( 0x00 ); //ponemos como salida el puertoB
output_low(pin_B1); //Apagamos las entradas a usar
output_low(pin_B0);
while(1){
// Se inicia una secuencia simple para poder verificar el funcionamiento
// del motor en conjunto con el pic.
output_low(pin_B0);
delay_ms(600);
output_high(pin_B1);
delay_ms(600);
output_low(pin_B1);
delay_ms(600);
output_high(pin_B0);
delay_ms(600);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment