How to Check Rechargeable Battery NiMH Status with Microcontroller?
The most accurate way to know how much energy is left in a battery is to monitor the voltage, current, and temperature over time, then use knowledge of that particular chemistry to estimate remaining energy.  There are ICs which do parts of this, sometimes called battery fuel guage ICs.  Of course you can do the same thing with a microcontroller, but it takes constant A/D readings and the algorithm can be complicated, depending on how accurate you want to be.

A much simpler but less accurate way is to just monitor voltage.  NiMH cells start at about 1.4 to 1.5 V right after being charged, quickly drop to 1.2 or so, go down only slowly over most of the discharge cycle, then drop quickly at the end of charge.  Usually you stop discharging at 900 mV or so.  Letting the voltage of any cell get less than that can risk permanent damage.

You could simply pick a voltage around 1.0 to 1.1 V and decide to warn the user when the battery gets that low, then go dead at 900 mV.  The best levels depend on your load.

Of course you need to consult the datasheet for whatever particular batteries you are using.  The manufacturer will give you discharge plots at various currents, tell you how low you can go without damage, etc.  As always read the datasheet.