please help see comments in program,
main.cpp
- Committer:
- jimspruell
- Date:
- 2013-06-23
- Revision:
- 0:7b3ba9fc5cad
File content as of revision 0:7b3ba9fc5cad:
#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