def showinfo(): info = "" yournum = sim800.getmynumber() if (yournum): info += yournum + "\n" yourop = sim800.currentoperator(0) if (yourop): info += "Operator : " + yourop + "\n" imei = sim800.imei() if (imei): info += "IMEI : " + imei + "\n" imsi = sim800.imsi() if (imsi): info += "IMSI : " + imsi + "\n" rssi = sim800.rssi() if (rssi): info += "RSSI : " + str(rssi) + "\n" ber = sim800.ber() if (ber): info += "BER : " + str(ber) + "\n" cellid = sim800.cellid() if (cellid): info += "Cell ID : " + cellid + "\n" yourbat = sim800.batterycharge() if (yourbat > 0): info += "Battery : " + str(yourbat) + "%\r\n" notice(info, title="TiLDA Phone")
"Temperature (tmp) : {:.2f} C".format(Sensors.get_tmp_temperature())) ugfx.Label( 5, 20, 240, 15, "Temperature (hdc) : {:.2f} C".format(Sensors.get_hdc_temperature())) ugfx.Label( 5, 35, 240, 15, "Humidity (hdc) : {:.2f} %".format(Sensors.get_hdc_humidity())) ugfx.Label(5, 50, 240, 15, "Light (opt) : {:.2f} Lux".format(Sensors.get_lux())) ugfx.Label(5, 65, 240, 15, "Mag Field: (drv) : {:.2f} ".format(mag.convert())) ugfx.Label(5, 80, 240, 15, "Sensor samplerate : {} ms".format(Sensors.sample_rate())) charging = Sensors.get_charge_status() if charging == Sensors.BAT_PRE_CHARGING or charging == Sensors.BAT_FAST_CHARGING: ugfx.Label(5, 110, 240, 15, "Battery is : charging") elif charging == Sensors.BAT_DONE_CHARGING: ugfx.Label(5, 110, 240, 15, "Battery is : full") elif charging == Sensors.BAT_NOT_CHARGING: ugfx.Label(5, 110, 240, 15, "Battery is : discharging") ugfx.Label(5, 125, 240, 15, "Battery is : {:.2f} %".format(sim800.batterycharge())) sleep(2) ugfx.clear() app.restart_to_default()
def battery(): return sim800.batterycharge( ) # todo: fix me, we can get this from the sim800