Thundersoft
/
PirSensor_for_TT_Mxx
Creating a project about PriSensor for TT_Mxx
main.cpp@0:8f7f050af5a8, 2019-03-21 (annotated)
- Committer:
- ThunderSoft
- Date:
- Thu Mar 21 10:01:07 2019 +0000
- Revision:
- 0:8f7f050af5a8
- Child:
- 3:65b6e5b2be31
Add PriSenor code for TT_Mxx
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ThunderSoft | 0:8f7f050af5a8 | 1 | #include "mbed.h" |
ThunderSoft | 0:8f7f050af5a8 | 2 | #include "PirSensor.h" |
ThunderSoft | 0:8f7f050af5a8 | 3 | |
ThunderSoft | 0:8f7f050af5a8 | 4 | |
ThunderSoft | 0:8f7f050af5a8 | 5 | |
ThunderSoft | 0:8f7f050af5a8 | 6 | |
ThunderSoft | 0:8f7f050af5a8 | 7 | |
ThunderSoft | 0:8f7f050af5a8 | 8 | |
ThunderSoft | 0:8f7f050af5a8 | 9 | #if __TT_M3HQ__ |
ThunderSoft | 0:8f7f050af5a8 | 10 | #define DISPLAY_TMPM_STRING "Welcome to Thundersoft TT_M3HQ" |
ThunderSoft | 0:8f7f050af5a8 | 11 | #endif |
ThunderSoft | 0:8f7f050af5a8 | 12 | |
ThunderSoft | 0:8f7f050af5a8 | 13 | |
ThunderSoft | 0:8f7f050af5a8 | 14 | #if __TT_M4G9__ |
ThunderSoft | 0:8f7f050af5a8 | 15 | #define DISPLAY_TMPM_STRING "Welcome to Thundersoft TT_M4G9" |
ThunderSoft | 0:8f7f050af5a8 | 16 | #endif |
ThunderSoft | 0:8f7f050af5a8 | 17 | |
ThunderSoft | 0:8f7f050af5a8 | 18 | DigitalOut testLed(LED1); |
ThunderSoft | 0:8f7f050af5a8 | 19 | |
ThunderSoft | 0:8f7f050af5a8 | 20 | static void pirHandle() |
ThunderSoft | 0:8f7f050af5a8 | 21 | { |
ThunderSoft | 0:8f7f050af5a8 | 22 | testLed = 1; |
ThunderSoft | 0:8f7f050af5a8 | 23 | wait_ms(5000); |
ThunderSoft | 0:8f7f050af5a8 | 24 | testLed = 0; |
ThunderSoft | 0:8f7f050af5a8 | 25 | } |
ThunderSoft | 0:8f7f050af5a8 | 26 | |
ThunderSoft | 0:8f7f050af5a8 | 27 | int main() |
ThunderSoft | 0:8f7f050af5a8 | 28 | { |
ThunderSoft | 0:8f7f050af5a8 | 29 | printf("%s\r\n",DISPLAY_TMPM_STRING); |
ThunderSoft | 0:8f7f050af5a8 | 30 | PirSensor pir; |
ThunderSoft | 0:8f7f050af5a8 | 31 | testLed = 1; |
ThunderSoft | 0:8f7f050af5a8 | 32 | pir.handleCallback(&pirHandle); |
ThunderSoft | 0:8f7f050af5a8 | 33 | while(1) |
ThunderSoft | 0:8f7f050af5a8 | 34 | { |
ThunderSoft | 0:8f7f050af5a8 | 35 | |
ThunderSoft | 0:8f7f050af5a8 | 36 | } |
ThunderSoft | 0:8f7f050af5a8 | 37 | } |