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: FRDM_MMA8451Q TSI USBDevice mbed
Revision 5:55ef207399fb, committed 2014-01-07
- Comitter:
- shutay
- Date:
- Tue Jan 07 09:36:19 2014 +0000
- Parent:
- 4:85ecc94a7643
- Commit message:
- Added API documentation.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Nov 21 06:49:25 2013 +0000
+++ b/main.cpp Tue Jan 07 09:36:19 2014 +0000
@@ -17,20 +17,31 @@
#define MMA8451_I2C_ADDRESS (0x1d<<1)
-// Freescale Freedom KL25Z board has an RGB LED on it.
+/// Freescale Freedom KL25Z board has an RGB LED on it.
DigitalOut ledRed(LED_RED);
DigitalOut ledGreen(LED_GREEN);
DigitalOut ledBlue(LED_BLUE);
-// Setup the serial over USB virtual COM port.
-//Serial pc(USBTX,USBRX);
+/** Setup the serial over USB virtual COM port.
+ * Note that the connection is made over the application USB port, NOT the CMSIS-DAP USB port.
+ * If you would like to use the debug/programmer USB port instead, the the following code:
+ *
+ * @code
+ * Serial pc(USBTX,USBRX);
+ * @endcode
+ *
+ * Notice that the default mbed USB CDC device will block on this declaration until you attach the KL25Z board
+ * to your PC's USB port and the device enumerates. After that, program execution will begin.
+ */
USBSerial pc;
int main()
{
char c;
int i=0;
+ /// Capacitive touch sensor, defined as tsi.
TSISensor tsi;
+ /// 3-axis MEMS accelerometer.
MMA8451Q acc(PTE25, PTE24, MMA8451_I2C_ADDRESS);
pc.printf("\nHello World!\n");