Programación De Pic Para Seguidor
#int_timer1
void timer1()
{
if(conta==2){
output_toggle(LED);
conta=0;
}
++conta;
}
void main()
{
PORTA_TRIS=3; PORTB_TRIS=0;PORTA_TRIS=0xFF; PORTB_TRIS=0;
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1 (T1_INTERNAL | T1_DIV_BY_1);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);port_b_pullups(TRUE);
setup_vref(FALSE);
enable_interrupts(INT_TIMER1);
enable_interrupts(GLOBAL);
do{
if(input(S1)){output_high(M1);}
else output_low(M1);if(input(S2)){output_high(M2); }
else output_low(M2);
delay_us(500);
}while(true);
}
#include "seguidor.h"
#int_timer1
void timer1()
{
if(conta==2){output_toggle(LED);
conta=0;
}
++conta;
}
void main()
{
PORTA_TRIS=3; PORTB_TRIS=0;
PORTA_TRIS=0xFF; PORTB_TRIS=0;
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_INTERNAL | T1_DIV_BY_1);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
port_b_pullups(TRUE);
setup_vref(FALSE);
enable_interrupts(INT_TIMER1);enable_interrupts(GLOBAL);
do{
if(input(S1)){output_high(M1);}
else output_low(M1);
if(input(S2)){output_high(M2); }
else output_low(M2);
delay_us(500);
}while(true);}
#include "seguidor.h"
#int_timer1
void timer1()
{
if(conta==2){
output_toggle(LED);
conta=0;
}
++conta;
}
void main()
{
PORTA_TRIS=3; PORTB_TRIS=0;PORTA_TRIS=0xFF; PORTB_TRIS=0;
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1 (T1_INTERNAL | T1_DIV_BY_1);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);port_b_pullups(TRUE);
setup_vref(FALSE);
enable_interrupts(INT_TIMER1);
enable_interrupts(GLOBAL);
do{
if(input(S1)){output_high(M1);}
else output_low(M1);...
Regístrate para leer el documento completo.