Hello, My program is functioning good now for the better part, the milliamp draw is down considerably which is great. Thanks again Steve! Now I need a kick start to: figuring out a way to set up a variable (if it's at all possible?) that I can use in an IF...Then statement to sound an alarm when the battery voltage (that powers the pic) drops to the level that the user can set using push buttons to change that variable. I did hear that there are voltage regulators that have a low voltage alarm built in so that's an option too.
For now I'm using a 5K pot connected to an ADC input in a 10 bit mode to simulate the batteries output voltage. Later I'll set up a voltage divider for the batteries and tap it off to the adc input. The code below that I'm using seems to be functioning as expected thanks to the PBP Archives.
The_Battery_Voltage = (The_Battery_Voltage */ 500)>>2
LCDOut $fe, 1,"DC Volts = ",DEC (The_Battery_Voltage/100),".", DEC2 _
The_Battery_Voltage
With the above code my 5K pot adjusts from 0.00 to 4.99 volts which as far as I can figure so far, should be good. I did a print to another screen without the math to show The_Battery_Voltage variable and it showed 1023 while the one with the math above was printing 4.99.
Would anyone know the math involved to create a word variable to accomplish this? Another option I have is to use another adc input using a 5K pot and use that variable in my IF...Then but I would like to go with push buttons. Any help would be greatly appreciated.
Thanks jessey
Bookmarks