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: mbed
Test.cpp
00001 #include "mbed.h" 00002 #include "MTSLog.h" 00003 00004 DigitalInOut myPort(PA_0); 00005 //DigitalOut myPort(PA_0); 00006 //DigitalIn myPort(PA_0); 00007 Serial debug(USBTX, USBRX); 00008 00009 main() 00010 { 00011 int i; 00012 bool mode = true; 00013 debug.baud(115200); 00014 myPort.mode(PullDown); 00015 mts::MTSLog::setLogLevel(mts::MTSLog::INFO_LEVEL); 00016 logInfo("Starting PA0 Tester"); 00017 for(i=0; i<200; i++) 00018 { 00019 logInfo("Running Loop %d", i); 00020 myPort.output(); 00021 int myData = mode ? 0 : 1; 00022 myPort.write(myData); 00023 logInfo("Set PA0: %d", myData); 00024 mode = !mode; 00025 wait(5); 00026 myPort.input(); 00027 int value = myPort.read(); 00028 logInfo("PA0 value: %d", value); 00029 wait(5); 00030 } 00031 } 00032
Generated on Sat Jul 16 2022 04:06:58 by
1.7.2