X10 Server - IOT device to leverage a collection of old X10 devices for home automation and lighting control.
Dependencies: IniManager mbed HTTPClient SWUpdate mbed-rtos Watchdog X10 SW_HTTPServer SW_String EthernetInterface TimeInterface SSDP
X10 Server
See the X10 Server Nodebook page
Diff: SignOfLife.cpp
- Revision:
- 7:16129d213e6a
- Child:
- 10:ca0c1db6d933
- Child:
- 12:67c524db9e07
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SignOfLife.cpp Wed Feb 27 18:24:32 2019 +0000 @@ -0,0 +1,22 @@ + +#include "SignOfLife.h" + +static PwmOut signOfLife[4] = {LED1, LED2, LED3, LED4}; + +/// ShowSignOfLife +/// +/// Pulse an LED to indicate a sign of life of the program. +/// This also has some moderate entertainment value. +/// +void ShowSignOfLife(int which) +{ +#define PI 3.14159265359 + static int degrees[4]; + float v; + which %= 4; // 0-3: LED1-4 + + degrees[which] += 10; + v = sin(degrees[which] * PI / 180)/2 + 0.5; + signOfLife[which] = v; // a little dimmer +} +