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:
- 52:701d0c2f47d7
- Parent:
- 46:cdc24a24e4e3
- Child:
- 53:1c61cadbcb35
diff -r a98ffbd41e76 -r 701d0c2f47d7 source/main.cpp
--- a/source/main.cpp Thu Mar 29 18:17:38 2018 +0000
+++ b/source/main.cpp Thu Mar 29 18:27:02 2018 +0000
@@ -1,7 +1,7 @@
#include "main.h"
-int state = 51;
+int state = 44;
int oldState;
Serial pc(USBTX, USBRX); // tx, rx
@@ -65,6 +65,14 @@
/**************************************************************/
/* Test Zone */
+
+ /* init PWM board */
+ case 44:
+ pc.printf("Init PWM\r\n");
+ initPWM(50);
+ enableOutput();
+ state = 47;
+ break;
/* Time test tool: set Time */
case 45:
@@ -94,7 +102,7 @@
/* Console State Switch */
case 47:
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.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\r51\ttest SD Card\n\r");
pc.scanf("%d", &state);
pc.printf("Switch to State %d\n\r",state);
fflush(stdin);
@@ -129,13 +137,14 @@
pc.printf("Servo output disabled\r\n\n");
state = 47;
break;
-
+
case 51:
- pc.printf("Init PWM\r\n");
- initPWM(50);
- enableOutput();
+ testSd();
+ pc.printf("\rSD Card test finished\r\n\n");
state = 47;
- break;
+ break;
+
+
default:
state = 47; /* Go to State Switch */
