Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MyLeds.h 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * The MySensors Arduino library handles the wireless radio link and protocol
  3. * between your home built sensors/actuators and HA controller of choice.
  4. * The sensors forms a self healing radio network with optional repeaters. Each
  5. * repeater and gateway builds a routing tables in EEPROM which keeps track of the
  6. * network topology allowing messages to be routed to nodes.
  7. *
  8. * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
  9. * Copyright (C) 2013-2018 Sensnology AB
  10. * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
  11. *
  12. * Documentation: http://www.mysensors.org
  13. * Support Forum: http://forum.mysensors.org
  14. *
  15. * This program is free software; you can redistribute it and/or
  16. * modify it under the terms of the GNU General Public License
  17. * version 2 as published by the Free Software Foundation.
  18. */
  19. #ifndef MyLeds_h
  20. #define MyLeds_h
  21. #ifdef MY_WITH_LEDS_BLINKING_INVERSE
  22. #define LED_ON 0x1
  23. #define LED_OFF 0x0
  24. #else
  25. #define LED_ON 0x0
  26. #define LED_OFF 0x1
  27. #endif
  28. #if defined(MY_DEFAULT_TX_LED_PIN) || defined(MY_DEFAULT_RX_LED_PIN) || defined(MY_DEFAULT_ERR_LED_PIN)
  29. #define ledBlinkTx(x,...) ledsBlinkTx(x)
  30. #define ledBlinkRx(x,...) ledsBlinkRx(x)
  31. #define ledBlinkErr(x,...) ledsBlinkErr(x)
  32. /**
  33. * Blink with LEDs
  34. * @param cnt how many blink cycles to keep the LED on. Default cycle is 300ms
  35. */
  36. void ledsInit();
  37. void ledsBlinkRx(uint8_t cnt);
  38. void ledsBlinkTx(uint8_t cnt);
  39. void ledsBlinkErr(uint8_t cnt);
  40. void ledsProcess(); // do the actual blinking
  41. /**
  42. * Test if any LED is currently blinking.
  43. * @return true when one or more LEDs are blinking, false otherwise.
  44. */
  45. bool ledsBlinking();
  46. #else
  47. // Remove led functions if feature is disabled
  48. #define ledBlinkTx(x,...)
  49. #define ledBlinkRx(x,...)
  50. #define ledBlinkErr(x,...)
  51. #endif
  52. #endif