Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystem mbed
Fork of PES4_Programme by
source/main.cpp
- Committer:
- aeschsim
- Date:
- 2018-03-27
- Revision:
- 34:9d6dd3a12641
- Parent:
- 27:bf0577ecfa6e
- Child:
- 35:a9bf045dc014
File content as of revision 34:9d6dd3a12641:
#include "main.h" int state = 46; int old_state; Serial pc(USBTX, USBRX); // tx, rx char buf[100]; int main() { pc.baud(460800); printf("start...\r\n"); while(1) { if(state != old_state) { printf("state: %d\r\n",state); old_state = state; } switch (state) { case 0: printf("Hello World"); state = 1; break; case 1: break; case 2: break; case 3: break; case 10: break; case 11: break; case 15: break; case 16: break; case 17: break; case 25: break; case 26: break; case 27: break; case 28: break; case 35: break; case 36: break; case 37: break; case 38: break; /* Time test tool */ case 45: s_time time; time.second = 30; time.minute = 53; time.hour = 12; time.day = 27; time.weekday = 2; time.month = 3; time.year = 18; pc.printf("set now time\r\n"); setTime(&time); pc.printf("read time: %d:%d:%d, %d.%d.20%d, weekday: %d\r\n",time.hour, time.minute, time.second, time.day, time.month, time.year, time.weekday); state = 46; pc.printf("change state to: %d\r\n",state); break; case 46: wait(5); time = getTime(); pc.printf("read time: %2d:%2d:%2d, %2d.%2d.20%2d, weekday: %d\r\n",time.hour, time.minute, time.second, time.day, time.month, time.year, time.weekday); state = 46; break; case 48: break; case 50: break; } } pc.printf("exit while 1 loop"); }