rednet.open("top")
p=peripheral.wrap("back")

while true do
    energy = p.getEnergyStored()
    maxEnergy = p.getMaxEnergyStored()
    energyPercent = tonumber(string.format("%.3f", energy / maxEnergy * 100))
    print(energyPercent .. "%")
    dataSend = {}
    dataSend["energyPercent"] = energyPercent
    dataSend["type"] = "energyCore"
    rednet.broadcast(dataSend)
    sleep(1)
end