
Test access to PA0 on MDot
Dependencies: mbed
Revision 1:879ca9867ac9, committed 2016-10-20
- Comitter:
- Roietronics
- Date:
- Thu Oct 20 10:57:06 2016 +0000
- Parent:
- 0:c0f9993af516
- Commit message:
- revised test
Changed in this revision
Test.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Test.cpp Thu Oct 20 10:12:03 2016 +0000 +++ b/Test.cpp Thu Oct 20 10:57:06 2016 +0000 @@ -9,19 +9,24 @@ main() { int i; + bool mode = true; debug.baud(115200); + myPort.mode(PullDown); mts::MTSLog::setLogLevel(mts::MTSLog::INFO_LEVEL); - for(i=0; i<500; i++) + logInfo("Starting PA0 Tester"); + for(i=0; i<200; i++) { - - myPort.output(); -// myPort = 1; -// wait(500); - myPort = 0; - wait(500); - myPort.input(); - i = myPort; - logInfo("PA0 value: %d", i); + logInfo("Running Loop %d", i); + myPort.output(); + int myData = mode ? 0 : 1; + myPort.write(myData); + logInfo("Set PA0: %d", myData); + mode = !mode; + wait(5); + myPort.input(); + int value = myPort.read(); + logInfo("PA0 value: %d", value); + wait(5); } } \ No newline at end of file