c program code for the problem statement

c
code
for
program
the

#1

In this event, a grid of paths and junctions shall be given to the partipants. Paths will be of white colour. Some junctions will have black colour and starting and end zones will be diagonally opposite. The bot should be completely autonomous. It should find all the black colored junctions in the arena and whenever it detects the black junction it should glow the LED. When it reaches the end zone it should show the total no. of black junctions it encountered in its path. If it shows all black junctions in the arena, then that team will be the winner. If more than one teams show the correct answer then the bot that completed the job fastest will be the winner!. During the run the bot has to count the number of black nodes in the 5x5 grid. There will be any number of black nodes on the grid and position of black nodes will be declared just before the match.
4. Bot should have 2 LEDs(1 Red,1 Green ) to display the detection of Black Nodes.
5. When the bot moves to any of the black node it has to show that by lighting one LED on that coordinate and it should continue glowing the led until next black node is detected .At that point it has to flip to another LED and switching off the previous one .Continue the same procedure till end of the run.
6. After the completion of task, the bot has to stop somewhere and it should display black nodes present in the arena on its LCD screen. LCD should display only two digit number.
7. The bot shall continue to show the total number of black nodes present after completion of the run on the LCD screen till the time organizer ask to switch it off.

port a for sensor inputs,port b for motor inputs,port d for lcd…