Anthony Mukuka Mwila / Mbed OS InterruptCounterTimertestUnit
Committer:
Amwila
Date:
Tue Oct 03 10:07:16 2017 +0000
Revision:
0:2a502be30ec8
Child:
1:6017f9971cc8
This is the first iteration of The Interrupt Counter unit that handles the input pulses on the specified gpio pins

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Amwila 0:2a502be30ec8 1 #if !FEATURE_LWIP
Amwila 0:2a502be30ec8 2 #error [NOT_SUPPORTED] LWIP not supported for this target
Amwila 0:2a502be30ec8 3 #endif
Amwila 0:2a502be30ec8 4
Amwila 0:2a502be30ec8 5 #include "mbed.h"
Amwila 0:2a502be30ec8 6
Amwila 0:2a502be30ec8 7 InterruptIn BLM_CHANNEL_A(PG_5);
Amwila 0:2a502be30ec8 8 InterruptIn BLM_CHANNEL_B(PG_4);
Amwila 0:2a502be30ec8 9 int A_count = 0 ;
Amwila 0:2a502be30ec8 10 int B_count = 0;
Amwila 0:2a502be30ec8 11
Amwila 0:2a502be30ec8 12
Amwila 0:2a502be30ec8 13 void IncB()
Amwila 0:2a502be30ec8 14 {
Amwila 0:2a502be30ec8 15 B_count ++ ;
Amwila 0:2a502be30ec8 16 printf("%d", B_count);
Amwila 0:2a502be30ec8 17 }
Amwila 0:2a502be30ec8 18 void IncA()
Amwila 0:2a502be30ec8 19 {
Amwila 0:2a502be30ec8 20 A_count ++ ;
Amwila 0:2a502be30ec8 21 printf("%d",A_count);
Amwila 0:2a502be30ec8 22 }
Amwila 0:2a502be30ec8 23
Amwila 0:2a502be30ec8 24
Amwila 0:2a502be30ec8 25 char Count[10] = "Hello";
Amwila 0:2a502be30ec8 26
Amwila 0:2a502be30ec8 27 int main()
Amwila 0:2a502be30ec8 28 {
Amwila 0:2a502be30ec8 29 printf("Man this actually works");
Amwila 0:2a502be30ec8 30 printf("This is my attempt to conduct a TCP Send \n");
Amwila 0:2a502be30ec8 31
Amwila 0:2a502be30ec8 32 while (true) {
Amwila 0:2a502be30ec8 33
Amwila 0:2a502be30ec8 34 BLM_CHANNEL_A.rise(&IncA);
Amwila 0:2a502be30ec8 35 BLM_CHANNEL_B.rise(&IncB);
Amwila 0:2a502be30ec8 36
Amwila 0:2a502be30ec8 37 printf("Count so far for Channel A:%d \n Count so far for Channel B : %d ",A_count ,B_count);
Amwila 0:2a502be30ec8 38 wait(2);
Amwila 0:2a502be30ec8 39 }
Amwila 0:2a502be30ec8 40 }
Amwila 0:2a502be30ec8 41