please help see comments in program,

Files at this revision

API Documentation at this revision

Comitter:
jimspruell
Date:
Sun Jun 23 20:51:43 2013 +0000
Commit message:
printf's don't work with InterruptIn() statement Please help !!!!; see comments in program

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jun 23 20:51:43 2013 +0000
@@ -0,0 +1,54 @@
+#include "mbed.h"
+
+DigitalOut LED(LED_RED);   // PTD1?
+
+
+//  help!!!!!!!!!!!!!!!!!!1
+/*
+program works fine whith the InterruptIN Event(PTA2);  COMMENTED OUT
+
+WITH THIS STATEMENT IN ALL THE printf's quit working, the LE still flashes every 2 seconds
+
+I am unsing with a Freescale FRDM-KL25Z CARD
+
+please email suggestions to make work  to jimspruell@comcast.net 
+
+*/
+
+
+//InterruptIn EVENT(PTA2);  //J1-PIN4, INT PORT A OR D ONLY)
+DigitalOut FLOW_P(PTD4);  //J1-PIN6  tied to pin4 
+
+int flow_counter,pass;    
+
+void trigger()
+{
+// interrupt flag clear?
+    flow_counter++;
+    printf( "flow_counter=%d \r\n", flow_counter );
+// return from interrupt?
+}
+
+int main()
+{
+
+    FLOW_P=0;            // pulse down
+//    EVENT.mode(PullUp);
+    pass = 0;
+    flow_counter = 0;      // flow
+  
+    printf("before event.rise() \r\n");
+//    EVENT.rise(&trigger);
+    printf("after event.rise() \r\n");    
+    LED=1;  
+    while(1)
+     {
+        LED = ! LED;
+        pass++;
+        FLOW_P = ! FLOW_P;
+        printf("pass = %d  flow_count=%d \r\n",pass,flow_counter);
+        wait(2.0f);
+     }
+ 
+  
+} // END OF MAIN 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jun 23 20:51:43 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file