My take on a demo for the Freescale FRDM KL25Z board showing off it's main features all at once together with USB CDC serial.

Dependencies:   FRDM_MMA8451Q TSI USBDevice mbed

Files at this revision

API Documentation at this revision

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");