This week my partner had design a first sample for mobile robot so had to create a programming for the circuit to show a basic movement of the robot such move left, right, forward, reverse and stop.
Figure below show the circuit design:
And this is the programming for the circuit:
#include <16f84a.h>
#fuses HS,NOWDT,PUT
#use delay(clock=20000000)
void main()
{
while(TRUE)
{
if(!input(pin_a0))
{
output_b(0x68);
delay_ms(3000);
output_b(0x6A);
}
else if(!input(pin_a1))
{
output_b(0x62);
delay_ms(3000);
output_b(0x6A);
}
else if(!input(pin_a2))
{
output_b(0x6A);
}
else if(!input(pin_a3))
{
output_b(0x74);
}
else if(!input(pin_a4))
{
output_b(0x00);
}
}
}
In this programming, i had use if-else function for the selection of input switch and the output controlled by sending a data to the whole port.
what the function for the pin11 and 12?? can you explain more clearly about this circuit??? tq..
ReplyDeleteWhat software did you use?
ReplyDelete