I'm thinking about starting a project that would basically mean the PIC having to learn.

Ill explain in the simplest analagies I can think of.

Picture a fuel guage, it works by having a variable resistor at the end, the resistance changes by going higher or lower resistance as the fuel goes higher or lower in the tank.

What I need to do is light 3 led's one for 3/4 full, one for half full and one for 1/4 full.


The problem I have is on each car the resistance for those measurments are totally different, and in some cases reversed.

My solution would be have the pic read the resistance attached to a pin or air of pins? say for instance I pour 1/4 of the liquid in the tank, then press a button, the pic would measure that resistance and store it in eeprom position 3, half full measure again and store in eeprom location 4, 3/4 full and store the resistance in location 5, and full store the resistance in location 6.
Theoretically if I can do this then when the "fuel" lever drops, I should be able to get it to compare the resistance on the pin and when it reaches the stored limits in any of the eeprom positions, It would activate one or more of the led's depending on the level.

Sorry if I'm not explaingin it very well I'm still very new at this pic lark and not certian of the terminology and in a lot of cases I'l learning as I'm going.

In this case I have no idea what I'd need or how to go about it, but if it is possible some ideas would be very welcome as would some sample code for those ideas, once I get the idea of what I'm actually meant to be doing I should be able to work it all out and hopefully complete it.

Its not a commercial project or school project, it's just an idea I have that could be used on several other ideas in the back of my head.

Any suggestions and or help very welcome.