Stefan Simbürger
/
PPM_Decoder2
Finished Decoder
Diff: main.cpp
- Revision:
- 1:da51d068920b
- Parent:
- 0:830dd1202b0b
- Child:
- 2:6b9833ee0cc6
--- a/main.cpp Thu Oct 15 10:15:29 2020 +0000 +++ b/main.cpp Thu Oct 15 16:54:55 2020 +0000 @@ -16,10 +16,15 @@ if(current_Ch >= 6000) { state_Of_Signal = 0; } + else if(current_Ch <= 1000) + { + return; + } else{ all_Ch[state_Of_Signal] = current_Ch; + state_Of_Signal++; } - state_Of_Signal++; + } int main() @@ -29,11 +34,11 @@ signal.fall(&isrFall); state_Of_Signal = 0; while (true) { - for(int i = 0; i <= 8; i++) + for(int i = 0; i < 8; i++) { - printf("Channel %d: %d \n", i, all_Ch[i]); + printf("Channel %d: %d \n", i + 1, all_Ch[i]); } - //printf("Timer %d\n", current_Ch); + printf("End of Signal\n"); wait_ms(2000); } return 0;