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")
import ugfx, app, sim800 from tilda import Buttons from tilda import Sensors from machine import ADC from time import sleep mag = ADC(ADC.ADC_HALLEFFECT) status_height = 20 ugfx.init() ugfx.clear() ugfx.set_default_font(ugfx.FONT_FIXED) simversion = sim800.getfirmwarever()[9:] simphonenumber = sim800.getmynumber() simoperator = sim800.currentoperator() if simphonenumber == None or len(simphonenumber) == 0: ugfx.Label(5, 155, 240, 15, "No Number Yet") else: ugfx.Label(5, 155, 240, 15, simphonenumber) if simoperator == None or len(simoperator) == 0: ugfx.Label(5, 170, 240, 15, "No Operator Yet") else: ugfx.Label(5, 170, 240, 15, "Your network is " + simoperator) ugfx.Label(5, 185, 240, 15, simversion) ugfx.Label(5, 300, 240, 15, "** Hold A or B or MENU to exit **")