![](/media/cache/profiles/logo.jpeg.50x50_q85.jpg)
Display Steuerung für Lampen per Relais. https://www.youtube.com/watch?v=_CupBMcZ8Xc
Dependencies: BSP_DISCO_F746NG F746_GUI LCD_DISCO_F746NG TS_DISCO_F746NG mbed
main.cpp@1:f316de154ff7, 2017-04-23 (annotated)
- Committer:
- hexfactory
- Date:
- Sun Apr 23 17:15:53 2017 +0000
- Revision:
- 1:f316de154ff7
- Parent:
- 0:da00b5dd65c6
Helligkeitssensor und T?rkontaktsensor - Display Steuerung [DE]; https://www.youtube.com/watch?v=9OA7kxGMPo8
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hexfactory | 1:f316de154ff7 | 1 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 2 | section 1 - includes |
hexfactory | 1:f316de154ff7 | 3 | ==============================================================================================*/ |
hexfactory | 1:f316de154ff7 | 4 | /* imported libs */ |
hexfactory | 0:da00b5dd65c6 | 5 | #include "mbed.h" |
hexfactory | 0:da00b5dd65c6 | 6 | #include "F746_GUI.hpp" |
hexfactory | 1:f316de154ff7 | 7 | |
hexfactory | 1:f316de154ff7 | 8 | /* project files */ |
hexfactory | 1:f316de154ff7 | 9 | #include "relay.h" |
hexfactory | 0:da00b5dd65c6 | 10 | #include "flash.h" |
hexfactory | 1:f316de154ff7 | 11 | #include "lightAutomatic.h" |
hexfactory | 0:da00b5dd65c6 | 12 | |
hexfactory | 1:f316de154ff7 | 13 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 14 | section 2 - private defines / enumerations |
hexfactory | 1:f316de154ff7 | 15 | ==============================================================================================*/ |
hexfactory | 0:da00b5dd65c6 | 16 | |
hexfactory | 1:f316de154ff7 | 17 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 18 | section 3 - private typedefs |
hexfactory | 1:f316de154ff7 | 19 | ==============================================================================================*/ |
hexfactory | 0:da00b5dd65c6 | 20 | |
hexfactory | 1:f316de154ff7 | 21 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 22 | section 4 - private macros |
hexfactory | 1:f316de154ff7 | 23 | ==============================================================================================*/ |
hexfactory | 0:da00b5dd65c6 | 24 | |
hexfactory | 1:f316de154ff7 | 25 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 26 | section 5 - public constants definition |
hexfactory | 1:f316de154ff7 | 27 | ==============================================================================================*/ |
hexfactory | 1:f316de154ff7 | 28 | |
hexfactory | 1:f316de154ff7 | 29 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 30 | section 6 - public variables/pointers definition |
hexfactory | 1:f316de154ff7 | 31 | ==============================================================================================*/ |
hexfactory | 1:f316de154ff7 | 32 | /* inputs */ |
hexfactory | 1:f316de154ff7 | 33 | DigitalIn g_doorSensor(D3, PullUp); |
hexfactory | 1:f316de154ff7 | 34 | DigitalIn g_lightSensor(D2, PullDown); |
hexfactory | 1:f316de154ff7 | 35 | |
hexfactory | 1:f316de154ff7 | 36 | /* outputs */ |
hexfactory | 1:f316de154ff7 | 37 | DigitalOut g_light1Fet1(D4, 0); |
hexfactory | 1:f316de154ff7 | 38 | DigitalOut g_light1Fet2(D5, 0); |
hexfactory | 1:f316de154ff7 | 39 | DigitalOut g_light2Fet1(D6, 0); |
hexfactory | 1:f316de154ff7 | 40 | DigitalOut g_light2Fet2(D7, 0); |
hexfactory | 1:f316de154ff7 | 41 | |
hexfactory | 1:f316de154ff7 | 42 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 43 | section 7 - private constants definition |
hexfactory | 1:f316de154ff7 | 44 | ==============================================================================================*/ |
hexfactory | 0:da00b5dd65c6 | 45 | |
hexfactory | 1:f316de154ff7 | 46 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 47 | section 8 - private variables/objects/pointers definition |
hexfactory | 1:f316de154ff7 | 48 | ==============================================================================================*/ |
hexfactory | 1:f316de154ff7 | 49 | |
hexfactory | 1:f316de154ff7 | 50 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 51 | section 9 - private functions - declaration |
hexfactory | 1:f316de154ff7 | 52 | ==============================================================================================*/ |
hexfactory | 1:f316de154ff7 | 53 | |
hexfactory | 1:f316de154ff7 | 54 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 55 | section 10 - private functions - implementation (definition) |
hexfactory | 1:f316de154ff7 | 56 | ==============================================================================================*/ |
hexfactory | 1:f316de154ff7 | 57 | |
hexfactory | 1:f316de154ff7 | 58 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 59 | section 11 - public functions - implementation (definition) |
hexfactory | 1:f316de154ff7 | 60 | ==============================================================================================*/ |
hexfactory | 1:f316de154ff7 | 61 | int main() |
hexfactory | 1:f316de154ff7 | 62 | { |
hexfactory | 1:f316de154ff7 | 63 | /* GUI Ojects */ |
hexfactory | 1:f316de154ff7 | 64 | Label labelTop(240, 2, "Display Steuerung v0.2", Label::CENTER, Font16); |
hexfactory | 1:f316de154ff7 | 65 | |
hexfactory | 0:da00b5dd65c6 | 66 | /*************************** |
hexfactory | 0:da00b5dd65c6 | 67 | init |
hexfactory | 1:f316de154ff7 | 68 | ***************************/ |
hexfactory | 1:f316de154ff7 | 69 | relay_init(); |
hexfactory | 0:da00b5dd65c6 | 70 | flash_init(); |
hexfactory | 1:f316de154ff7 | 71 | lightAutomatic_init(); |
hexfactory | 0:da00b5dd65c6 | 72 | |
hexfactory | 0:da00b5dd65c6 | 73 | /*************************** |
hexfactory | 0:da00b5dd65c6 | 74 | main loop |
hexfactory | 0:da00b5dd65c6 | 75 | ***************************/ |
hexfactory | 1:f316de154ff7 | 76 | while(1) |
hexfactory | 1:f316de154ff7 | 77 | { |
hexfactory | 1:f316de154ff7 | 78 | relay_task(); |
hexfactory | 1:f316de154ff7 | 79 | lightAutomatic_task(); |
hexfactory | 1:f316de154ff7 | 80 | flash_task(); |
hexfactory | 0:da00b5dd65c6 | 81 | } |
hexfactory | 1:f316de154ff7 | 82 | } |
hexfactory | 1:f316de154ff7 | 83 | |
hexfactory | 1:f316de154ff7 | 84 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 85 | section 12 - interrupt service routines (ISRs) |
hexfactory | 1:f316de154ff7 | 86 | ==============================================================================================*/ |
hexfactory | 1:f316de154ff7 | 87 | |
hexfactory | 1:f316de154ff7 | 88 | /*============================================================================================= |
hexfactory | 1:f316de154ff7 | 89 | end of file |
hexfactory | 1:f316de154ff7 | 90 | ==============================================================================================*/ |