forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I get the real capacity ?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
yucopowo2009



Joined: 18 Sep 2009
Posts: 6

PostPosted: Sat Apr 17, 2010 6:03 pm    Post subject: How can I get the real capacity ? Reply with quote

After a long time,the capacity of the psp battery will decrease
Now How can I get the real value.
For example , the PSPPlore can do it!
Back to top
View user's profile Send private message
Oby1Chick



Joined: 13 Feb 2010
Posts: 24

PostPosted: Sat Apr 17, 2010 10:25 pm    Post subject: Reply with quote

Well, I think it is the following code :
Code:

const int min = 0, max = 10;
srand(time(NULL));
int battery_life = (rand() % (max - min + 1)) + min;
printf("Battery life in years : %d ", battery_life);


Nah, jokes xD.
You could use load PSP type and battery ID to try to compute an approximate battery capacity.
But if you want really want to use the same way as PSPPlorer, you should take a look here :
http://pspzorba.com//articles/articles.php

There are many interesting code samples.
Its also the official website of PSPPlorer and the developper has released parts of his source code, maybe the whole source code in fact, I don't know.
Good luck.
Back to top
View user's profile Send private message
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Sun Apr 18, 2010 12:49 am    Post subject: Reply with quote

Look in your sdk in the include psppower.h you have all the functions related to battery ;)

Code:

/**
 * Get battery life as integer percent
 *
 * @return Battery charge percentage (0-100), < 0 on error.
 */
int scePowerGetBatteryLifePercent(void);

/**
 * Get battery life as time
 *
 * @return Battery life in minutes, < 0 on error.
 */
int scePowerGetBatteryLifeTime(void);

/**
 * Get temperature of the battery
 */
int scePowerGetBatteryTemp(void);
/**
 * Get battery volt level
 */
int scePowerGetBatteryVolt(void);
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Oby1Chick



Joined: 13 Feb 2010
Posts: 24

PostPosted: Sun Apr 18, 2010 3:29 am    Post subject: Reply with quote

sauron_le_noir wrote:
Look in your sdk in the include psppower.h you have all the functions related to battery ;)
.

Yeah, you may find stuff here.
But he did not mean battery life (Correct me if I am wrong), he meant capacity, that decrease slowly and makes your PSP battery dies after a long time.
You could also check battery level and battery real voltage to see if they are not normally proportionnal.
Back to top
View user's profile Send private message
Davee



Joined: 22 Jun 2009
Posts: 59

PostPosted: Sun Apr 18, 2010 4:21 am    Post subject: Reply with quote

Oby1Chick wrote:
sauron_le_noir wrote:
Look in your sdk in the include psppower.h you have all the functions related to battery ;)
.

Yeah, you may find stuff here.
But he did not mean battery life (Correct me if I am wrong), he meant capacity, that decrease slowly and makes your PSP battery dies after a long time.
You could also check battery level and battery real voltage to see if they are not normally proportionnal.


S'kinda ambigious as here we say the capacity is the remaining battery percent.

Both is correct though, OP needs to provide more info.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group