program encoder with arduino uno to control distance.

Hi guys ; i really need your help to do the following task we want to make minesweeper , and we use Arduino Uno to control our robot . we use optical encoder to control distance . the problem in programming is : we want the encoder to send a signal to the arduino every (1 meter ) and if the metal detector send a single during this meter these coordinates will be saved in array or something like it . so i want to know how i can do this how i can link arduino with encoder and program it correctly how i can take the signal of metal detector and finally ... how i save coordinates . i need urgent help and thank you .

I think that the poetry forum is down the road a ways. A LONG ways.

Using reasonable posting techniques is far more likely to get you help.

Define what optical encoder you are using, and how it is connected to the Arduino would be useful, too.

and if the metal detector

What metal detector?

send a single during this meter

A single what? Flower? Bottle of champagne? Singing telegram? Stripper?

these coordinates will be saved in array or something like it .

Is a grocery bag something like an array? Is the bit bucket something like an array?