Sensor + EEPROM

Hello, i need some advice on sensor + EEPROM Programming. I use ultrasonic sensor as the eye of the robot(SLAM+mobile robot). So this is what i am thinking to make the sensor work better, for the first reading, the sensor will read the A obstacle, then the reading will be write on the PIC EEPROM. Then when the robot move forward it will sense the second obstacle which is B. I want to make the second reading produce 2 readings, which means the robot will still sense the A obstacle while sense the B obstacle. Then the readings will be write on the EEPROM with different address.

So, anyone can help me…

I can’t fully support your PIC coding efforts. But why do you need to use EEPROM? It’s generally easier to use RAM because your C compiler probably has built-in support for reading and writing from RAM. EEPROM is only needed if you want your microcontroller to remember some data while it is powered off (or if you’re completely out of RAM).

I suggest that you start by breaking this project up in to simpler parts. First you should make your microcontroller blink an LED. Than you should make your microcontroller read the sensor and blink the LED in some pattern depending on the sensor output (e.g. turn the LED on whenever an object is sensed).