--Battery
unloadbuff()
battfull=Image.load("battery/full.png")
batthalf=Image.load("battery/half.png")
battthird=Image.load("battery/last.png")
battdead=Image.load("battery/dead.png")

batteryLife = System.powerGetBatteryLifePercent()

while true do
screen:clear()

-- Blit battery --
if batteryLife > 75 then
screen:blit(460,240,battfull)
elseif batteryLife < 75 and batteryLife > 50 then
screen:blit(460,240,batthalf)
elseif batterLife < 50 and batteryLife > 25 then
screen:blit(460,240,battthird)
elseif batterLife < 25 and batteryLife > 0 then
screen:blit(460,240,battdead)
end

screen:clear()
screen.flip()
screen.waitVblankStart()
end