powerGetBatteryLifePercent ???

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
arrggg
Posts: 11
Joined: Thu Sep 29, 2005 10:07 am

powerGetBatteryLifePercent ???

Post by arrggg »

I tried a simple program..

Code: Select all

System.usbDiskModeActivate()
-- Battery Level View
white = Color.new(255, 255, 255)
screen:clear()
batlev = System.powerGetBatteryLifePercent()
screen:print(11, 2, string.format("%d", batlev), white)
screen.flip()
screen.waitVblankStart(3000)
and i get
error: test.lua:5: attempt to call field 'powerGetBatteryLifePercent' (a nil value)[/code]
Koba
Posts: 59
Joined: Thu Sep 29, 2005 10:57 am

Post by Koba »

i am having this exact same problem, thats why i am here lol, but i can't ever seem to get System.powerGetBatteryLifePercent() to work... i'll keep an eye out for any projects that use the command to see what we are doing wrong.
Koba
Posts: 59
Joined: Thu Sep 29, 2005 10:57 am

Post by Koba »

ok, download this version of LUA: http://www.luaplayer.org/LuaPlayer_v0.1 ... ware15.zip
and then the powerGetBatteryLifePercent() command will work. now my question is, how do i store that in a integer? or how do i create integers in lua?
Post Reply