GithubHelp home page GithubHelp logo

vvip-68 / nodemcu-mqtt-ws2812 Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 9.0 9.37 MB

NodeMCU-MQTT-WS2812 - эффекты для адресной ленты

C++ 82.45% C 13.08% Makefile 0.05% Python 0.30% HTML 1.04% CMake 0.56% Shell 0.23% SCSS 0.77% TypeScript 1.52%

nodemcu-mqtt-ws2812's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodemcu-mqtt-ws2812's Issues

Отключение MQTT

Здравствуйте. Как отключить в прошивке использование MQTT сервера, и WiFi. Нужно только циклическое повторение эффектов.

Сервис который предлагается в инструкции стал платным

А как использовать другой я чет не допетрил. Многие что нахожу предлагают чисто адрес и порт , иногда даже без логина и пароля. Тоесть чисто теоретически его можно наверное было бы использовать , но как идентифицировать своё устройство на этом сервере не понятно.
Истина где то рядом.

A few improvements

  1. Better randomization. Right now random seed using signal from analog input 0. It is much better to use hardware randomizer or at least also includes micro seconds:

WS2812_FX_1.02.ino

// точно таком же формате вынесен в отдельный файл 'settings.h' и переменные при сборке скетча будут браться из него.
+ // You can comment it out if you do not have HW random or do not want to use it.
+ #define TRUE_RANDOM
// #define public

...

  delay(100);

- randomSeed(analogRead(0));
+ #ifdef TRUE_RANDOM
+   unsigned long seed = (int)RANDOM_REG32;
+ #else
+   unsigned long seed = (int)(analogRead(0) ^ micros());
+ #endif
+   NotifyInfo("seed:" + String(seed));
+   randomSeed(seed);
  EEPROM.begin(512);
  1. The next change will randomize mode's durations in random mode if you do not like pre-defined per-mode durations:

WS2812_FX_1.02.ino

+ // You can comment it out to restore original logic
+ #define RANDOMIZE_DURATION
+ #define RANDOM_DURATION_MIN 30000
+ #define RANDOM_DURATION_MAX 90000
+ #define RANDOM_DURATION_STEP 5000
// #define public

CONTROL.ino

int getRandomMode() {
  return fav_modes[random(0, fav_modes_num - 1)];        // получаем новый случайный номер следующего режима
}

+ int getRandomDuration(int iMin, int iMax, int iStep = 5000){
+   int steps = 1 + round((iMax - iMin) / iStep);
+   return iMin + iStep * random(0, steps);
+ }

void resetModeVariables() {

...

    thisstep = param.step;
+    #ifdef RANDOMIZE_DURATION
+      if(randomModeOn) change_time = getRandomDuration(RANDOM_DURATION_MIN, RANDOM_DURATION_MAX, RANDOM_DURATION_STEP);
+    #endif
  }
  1. After first initialisation power settings should be saved as well (IMHO):
    EPROM.ino
  // После первой инициализации значений - сохранить их принудительно
-  if (!isInitialized) saveSettings();
+  if (!isInitialized){
+     saveSettings();
+     savePowerSettings();
+ }
}

Работа с Wemos D1 mini

@vvip-68, судя по коммитам, получается отлично доработанный проект Алекса!
Подскажите, будет ли скетч работать с Wemos D1 mini?
Спасибо.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.