简易的获取设备运行时间
String getTime(){uint32_t time=millis();
int day=time / 86400000;
int hour=(time-(86400000*day)) / 3600000;
int min=(time-(86400000*day)-(3600000*hour)) / 60000;
String timeStr=String(day)+"天"+String(hour)+"时"+String(min)+"分";
return timeStr;
}
然后可通过Text1.print(getTime()); 传输到APP显示 谢谢分享!!!!试试看! 芜湖起飞:P GOOD!!!VERY
页:
[1]