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
Diff: source/main.cpp
- Revision:
- 42:ba59ed6a2a06
- Parent:
- 41:f054a83f9556
- Child:
- 46:cdc24a24e4e3
--- a/source/main.cpp Wed Mar 28 13:51:49 2018 +0000 +++ b/source/main.cpp Thu Mar 29 08:47:47 2018 +0000 @@ -1,7 +1,7 @@ #include "main.h" -int state = 47; +int state = 51; int oldState; Serial pc(USBTX, USBRX); // tx, rx @@ -93,8 +93,8 @@ /* Console State Switch */ case 47: - pc.printf("State Switch: Enter next State: \n\r"); - pc.printf("45\tset Time\n\r46\tread Time\n\r47\tState Switch\n\r48\tServo Board Test Tool\n\t49\tempty\n\r50\tempty\n\r"); + pc.printf("\n\rState Switch: Enter next State: \n\r"); + pc.printf("45\tset Time\n\r46\tread Time\n\r47\tState Switch\n\r48\tServo Board Test Tool\n\r49\tenable servo output\n\r50\tdisable servo output\n\r"); pc.scanf("%d", &state); pc.printf("Switch to State %d\n\r",state); fflush(stdin); @@ -118,15 +118,23 @@ break; case 49: + enableOutput(); + pc.printf("Servo output enabled\r\n\n"); state = 47; break; - case 50: - + disableOutput(); + pc.printf("Servo output disabled\r\n\n"); state = 47; break; + case 51: + pc.printf("Init PWM\r\n"); + initPWM(60); + enableOutput(); + state = 47; + break; default: state = 47; /* Go to State Switch */ break;