When debugging code it can be handy to examine/alter variables and to check the state of input lines. So your main program can run and you have access to alter variables and run functions from a terminal. In this sample the main program is just a loop that flashes an LED. In that loop a periodic call is made to ShellTC which handles any commands from the serial terminal. The code is a bit quirky(it was originally written for a very resource limited device) but it works well enough to be useful, hence its published. More details in the main.cpp

Dependencies:   mbed

.

Revision:
3:6a35fb789679
Parent:
2:1a5802e3eb30
Child:
4:107d2d3294da
--- a/main.cpp	Wed Feb 04 20:53:21 2015 +0000
+++ b/main.cpp	Wed Feb 04 21:07:52 2015 +0000
@@ -23,12 +23,25 @@
 DigitalOut myled3(LED3);
 
 //Define the A2D convertor Pins
+#ifdef TARGET_LPC1768
 AnalogIn a2d1(p15);
 AnalogIn a2d2(p16);
 AnalogIn a2d3(p17);
 AnalogIn a2d4(p18);
 AnalogIn a2d5(p19);
 AnalogIn a2d6(p20);
+#endif
+#ifdef TARGET_KL25Z
+
+AnalogIn a2d1(PTB0);
+AnalogIn a2d2(PTB1);
+AnalogIn a2d3(PTB2);
+AnalogIn a2d4(PTB3);
+AnalogIn a2d5(PTC1);
+AnalogIn a2d6(PTC2);
+
+
+#endif
 
 int main() {
 setbuf(stdout, NULL);