Fx-9860 battery indicator (C)

Learn how to program. Code snippets for creating sprites etc. Submit your own or use those of others.
Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Re: Re:

Postby SimonLothar » Mon Sep 24, 2012 5:51 pm

happy wrote:In GII-2, MainBatteryPercentage() doesn't work, gives the wrong value.

IsSlim returns the wrong value on the GII-2 calculators.
Either delete

Code: Select all
   if (IsSlim()){
      *firstlevel = 0x2AA;
      *secondlevel = 0x288;

or replace IsSlim() by

Code: Select all
#define OS202GII2 0x02020000
char IsSlim(){
   if ( ( OSVersionAsInt() & 0xFFFF0000 ) == OS202GII2 ) return 0;
   else return !( *(char*)PORT_E_DR & 0x08 );
I'll be back!

Senior Member
Posts: 68
Joined: Tue May 08, 2012 5:40 pm

Re: Fx-9860 battery indicator (C)

Postby happy » Mon Sep 24, 2012 6:05 pm

Super, this works!


Return to Tutorials & Code Snippets

Who is online

Users browsing this forum: No registered users and 24 guests