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
Revision 2:fe6a81c5e6b8, committed 2019-01-09
- Comitter:
- odb
- Date:
- Wed Jan 09 04:24:37 2019 +0000
- Parent:
- 1:4a3198da4fe1
- Commit message:
- Digital Sensor test for the CORE-1000
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Feb 03 08:04:04 2017 +0000
+++ b/main.cpp Wed Jan 09 04:24:37 2019 +0000
@@ -1,17 +1,24 @@
#include "mbed.h"
-DigitalOut myled(PC_9);
-DigitalIn Sensor_DIN(PA_6);
+//DigitalOut mybuzzer(PC_4);
+//PwmOut mypwmR(PB_5);
+//PwmOut mypwmG(PB_3);
+//PwmOut mypwmB(PA_10);
+DigitalOut myled[4] = { PC_9, PB_2, PC_2, PC_3};
+
+DigitalIn Sensor_DIN(PA_6);
+Serial pc(USBTX, USBRX); // tx, rx
int main() {
- printf("\n Sensor Digital InPut example\n");
+ pc.baud(115200);
+ pc.printf("\n Sensor Digital InPut example\n");
while(1) {
if (Sensor_DIN == 0){
- myled = 1;
- printf("sensor detected \n\r");
+ myled[0] = 1;
+ pc.printf("sensor detected \n\r");
}
else{
- myled = 0;
+ myled[0] = 0;
}
}
}