hi,
this code is for my elevator project (using using pic c)
[ 3 floors with 3 pushbuttom & 3 limit switches] al are outside.
but ther is aproblem, that u should keep pressing on pushbuttom to order the elevator room...
any advices?????
thanks in advance
//////////////////Initiliziation///////////////////////
#include <16f877a.h>
#fuses hs,NOWDT
#use delay(clock=8000000)
#bit t1_overflow=0x0C.0
set_tris_b(0b11111111);//define port B as input port
set_tris_c(0b11111111);//define port C as input port
/////////////////////Main Program///////////////////////////////////
void main() {
int Sensor;
int Order;
start:
Order= input_C();
Sensor= input_B();
if (Order==Sensor)
{
output_low(PIN_a0);
output_low(PIN_a1);
goto start;
}
else if(Sensor > Order)
{
output_high(PIN_a0);
output_low(PIN_a1);
}
else
{
output_high(PIN_a1);
output_low(PIN_a0);
}