How to read a high voltage logic signal with pic microcontroller
Use Voltage Divider Circuit to read the battery level 


Firstly convert 12V to 5V (or 3.3V depending on the micro controller)
Use ADC to read the input voltage level.


If your PIC ADC support 3.3V then circuit will look like this one
  

If support 5V then use this
 

Note: If you want high accuracy choose right resistors for circuit, resistance value should be small as possible but same time it should not draw enough current that will effect battery. For more detail see this Link