NodeMCU Egg Status

files.catbox.moe/tfdw82.mp4
tiktok.com/@vgmllr/video/7568724622263323934




  1. // remote egg status
  2. // vgmlr
  3. #include "ESP8266WiFi.h"
  4. #include "ESP8266HTTPClient.h"
  5. #include "WiFiClient.h"
  6. // set local
  7. const char* ssid = "yourwifi";
  8. const char* password = "password";
  9. // set get url
  10. // http unless certificate finger-print
  11. // text shd be 000000000 format (rgb)
  12. const char* dest = "http://yourdomain.com/egg.txt";
  13. WiFiClient WifiClient;
  14. #include "FastLED.h"
  15. #define NLEDS 24
  16. #define LTYPE WS2812B
  17. #define CORDER GRB
  18. CRGB leds[NLEDS];
  19. const int neo_pin = D6;
  20. const long minutes = 30;
  21. const long hold = (minutes * 60 * 1000);
  22. int txtvalue;
  23. String eggvalue;
  24. void n_one (int r, int g, int b) {
  25. leds[0] = CRGB (r,g,b);
  26. FastLED.show();
  27. }
  28. void n_fade (int r, int g, int b) {
  29. for (int v = 0; v < NLEDS; v++) {
  30. leds[v] = CRGB (r,g,b);
  31. FastLED.show();
  32. delay(100);
  33. }
  34. }
  35. void n_show (int r, int g, int b) {
  36. for (int v = 0; v < NLEDS; v++) {
  37. leds[v] = CRGB (r,g,b);
  38. FastLED.show();
  39. }
  40. }
  41. void setup() {
  42. Serial.begin(115200);
  43. FastLED.addLeds< LTYPE, neo_pin, CORDER >(leds, NLEDS).setCorrection(TypicalLEDStrip);
  44. n_show(0, 0, 0); // clear
  45. // load notification
  46. n_fade(255, 0, 255);
  47. delay(10);
  48. n_fade(0, 0, 0);
  49. delay(10);
  50. n_show(0, 0, 0);
  51. }
  52. void loop() {
  53. // run get
  54. get_status();
  55. // parse and convert to int
  56. int red = eggvalue.substring(0, 3).toInt();
  57. int green = eggvalue.substring(3, 6).toInt();
  58. int blue = eggvalue.substring(6).toInt();
  59. // send to fastled
  60. n_fade(red, green, blue);
  61. n_show(red, green, blue);
  62. // wait for next get
  63. delay(hold);
  64. }
  65. void get_status () {
  66. WiFi.mode(WIFI_STA);
  67. delay(100);
  68. WiFi.begin(ssid, password);
  69. while (WiFi.status() != WL_CONNECTED) {
  70. n_one(255, 0, 0);
  71. delay(500);
  72. n_one(0, 0, 0);
  73. delay(500);
  74. }
  75. if (WiFi.status() == WL_CONNECTED) {
  76. HTTPClient http;
  77. http.begin(WifiClient, dest);
  78. txtvalue = http.GET();
  79. if (txtvalue == HTTP_CODE_OK) {
  80. eggvalue = http.getString();
  81. }
  82. http.end();
  83. }
  84. delay(500);
  85. WiFi.mode(WIFI_OFF);
  86. }
Update(s)-
1. ptmr | 343025 [Changelog]
10:22 343 025
Dev-
1. TVShow (227) 'CSA'
2. Wedge (Miter) 1.0.0
3. TVShow (228) 'APT'
4. TVProgram (83) 'BXT'
11:51 339 025

Menu
Index
Engineering
Entertainment
Literature
Miscellaneous
Contact
Search
tiktok.com/@vgmlr
youtube.com/@vgmlr
Miter
@vgmlr
=SUM(parts)
86 miters
131 tenons
Subscribe
0.00091