/roboti/solarni/main.c |
---|
0,0 → 1,64 |
#include "D:\@Kaklik\programy\PIC_C\robot\solarni_robot\main.h" |
#define LED pin_B3 |
#define ON_TIME 100 // Cas sepnuti rele |
#define meridlo pin_B2 |
void rele1() // Sepnuti prvniho rele |
{ |
output_low(PIN_A1); |
output_low(PIN_B4); |
delay_ms(ON_TIME); |
output_high(PIN_A1); |
output_high(PIN_B4); |
} |
void motor() |
{ |
output_low(pin_A2); |
output_low(pin_B1); |
output_low(PIN_A4); |
delay_ms(ON_TIME); |
output_high(pin_A2); |
output_high(pin_B1); |
output_high(PIN_A4); |
} |
void rele2() |
{ |
output_low(pin_B5); |
output_low(pin_A0); |
delay_ms(ON_TIME); |
output_high(pin_A0); |
output_high(pin_B5); |
} |
void main() |
{ |
output_high(pin_B0); |
While (true) |
{ |
output_high(LED); |
delay_ms(25); //vystavni blikani |
output_low(LED); |
Delay_ms(1000); |
} |
/* rele1(); |
while (!input(meridlo)) |
delay_ms(100); |
rele2(); |
while (!input(meridlo)) |
delay_ms(100); |
motor(); |
output_low(pin_B0); |
*/ |
} |