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.
Fork of FRDM_TSI by
Revision 6:288cb3530ef4, committed 2015-05-07
- Comitter:
- lmsousa
- Date:
- Thu May 07 11:25:42 2015 +0000
- Parent:
- 5:b44f5f02b879
- Commit message:
- Sends TSI read value to the serial port.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu May 09 09:26:46 2013 +0000
+++ b/main.cpp Thu May 07 11:25:42 2015 +0000
@@ -1,12 +1,19 @@
#include "mbed.h"
#include "TSISensor.h"
+Serial pc(USBTX, USBRX);
-int main(void) {
- PwmOut led(LED_GREEN);
+int main(void)
+{
+ pc.baud(9600);
+ PwmOut rled(LED_RED);
TSISensor tsi;
-
- while (true) {
- led = 1.0 - tsi.readPercentage();
- wait(0.1);
- }
-}
\ No newline at end of file
+ rled=1;
+
+ while (true)
+ {
+ float n=tsi.readPercentage();
+ pc.printf("Percentage= %3.0f %% \r\n ",n*100);
+ rled = 1.0 - n;
+ wait(0.1);
+ }
+}
