Thundersoft
/
PirSensor_for_TT_Mxx
Creating a project about PriSensor for TT_Mxx
main.cpp@3:65b6e5b2be31, 2019-05-15 (annotated)
- Committer:
- ThunderSoft
- Date:
- Wed May 15 13:13:42 2019 +0000
- Revision:
- 3:65b6e5b2be31
- Parent:
- 0:8f7f050af5a8
Cancel delay.
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 | 3:65b6e5b2be31 | 22 | testLed = !testLed; |
ThunderSoft | 0:8f7f050af5a8 | 23 | } |
ThunderSoft | 0:8f7f050af5a8 | 24 | |
ThunderSoft | 0:8f7f050af5a8 | 25 | int main() |
ThunderSoft | 0:8f7f050af5a8 | 26 | { |
ThunderSoft | 0:8f7f050af5a8 | 27 | printf("%s\r\n",DISPLAY_TMPM_STRING); |
ThunderSoft | 0:8f7f050af5a8 | 28 | PirSensor pir; |
ThunderSoft | 0:8f7f050af5a8 | 29 | testLed = 1; |
ThunderSoft | 0:8f7f050af5a8 | 30 | pir.handleCallback(&pirHandle); |
ThunderSoft | 0:8f7f050af5a8 | 31 | while(1) |
ThunderSoft | 0:8f7f050af5a8 | 32 | { |
ThunderSoft | 0:8f7f050af5a8 | 33 | |
ThunderSoft | 0:8f7f050af5a8 | 34 | } |
ThunderSoft | 0:8f7f050af5a8 | 35 | } |