Other Parts Discussed in Thread: MSP430FG4618, MSP430G2553
Hello,
I have designed a talking alarm clock using MSP430FG4618 experiments board. However, on the display i noticed that there is a battery indicator symbol
that i can use. It should be very simple to implement it. But i cannot get my head around it. Can anyone help me with this.
#define BAT_FULL LCDM12 |= 0x0F // BAT_FULL = "BB"+"B0"+"B1"+"BT" (ON)
#define BAT_LOW LCDM12 |= 0x08 // BAT_LOW = "BB" (ON)
#define BAT_50 LCDM12 |= 0x0C // BAT_50% = "BB"+"B0" (ON)
#define BAT_90 LCDM12 |= 0x0e // BAT_90% = "BB"+"B0"+"B1" (ON)
I have defined the following variables just to indicate the status of the battery.
The way i m thinking about it is a bunch of if conditions . LIke
If (something is true)
{ BAT_FULL;}......
if(something else is true){
BAT_LOW;}
I m not sure what comparison to make....maybe the ADC ref ....but how??? Please help...some kind of short code will be appreciated...or some kind of direction....??