Comments (3)
Hi @dimiHH,
thanks for the good feedback.
Regarding your idea: Wouldn't it work to check for button presses in the main loop() and change the mode according to your keypresses. So you could cycle through predefined modes.
Analog A0 should be used. Where did you see that? You're free to use the pins that are not covered be the LED strip.
Regards
Tobias
from mclighting.
thanks for the quick response @toblum , your approache also seems more elegant (it makes it possible to switch to to other predifined modes via the the browser without "unswitching" a physical button first)
So as see it, the following things need to be done for the changes I want:
- define a function "whitelight" somewhere in colormodes.h
void whitelight () {
checkForRequests();
if (exit_func) {
exit_func = false;
return;
}
// is the upper part necessary?:
strip.setColor(255, 255, 255);
strip.setBrightness(analogRead (map(0, 1024, 0, 255) );
strip.setMode(FX_MODE_STATIC);
}
- Add the whitelight-mode to the state machine in McLighting.ino (e.g. after the TV-Mode):
if (mode == WHITELIGHT) {
whitelight ();
}
- Add a physical pushbutton and corresponding code, that sets the mode==WHITELIGHT if button is pushed. ( at the very beginning of the main loop() in McLighting.ino):
if (button.onPressed()) { //button.onPressed function is from RBDbutton library -Button will be at GPIO12
mode = WHITELIGHT;
}
Would that already be it or did I miss something?
Thanks!
Dimi
PS:
About the A0 usage:
in this loop A0 is used - what is it for? --> It seems, that the analog input is/can be send to the webinterface aswell. Is this used to controll the brightness globaly (i.e. for all the modes)? If yes, that would make the code adjustments minmal (on button-push only the colors need to be set to white and the mode has to be changed to mode=ALL)
from mclighting.
From what I can see here, this should work.
Regarding A0: This is just some sample code I forgot. It has no real function. The line
McLighting/Arduino/McLighting/McLighting.ino
Line 379 in 20ef1b9
from mclighting.
Related Issues (20)
- Cant Open/Import McLightingApp.aia HOT 2
- Change Hostname ? HOT 1
- Issues setting up Adafruit_MQTT configuration from wifiManager in Arduino
- Changing led pin issue? HOT 5
- E1.31 animations very laggy
- No Wifi connection although AP-Mode is quit
- What syntax should I use for domoticz HOT 1
- NUMLEDS Error HOT 1
- McLighting (esp8266) HOT 4
- No Wifi Network HOT 1
- Adding a selector switch in homebridge
- Home assistant Support
- USE_WS2812FX_UART1
- Flash Size ESP8266 2.7.4 HOT 1
- Build error HOT 3
- Start Problems ESP 8266 & WS2811
- Compile Error ... HOT 1
- connecting Octoprint (raspberry pi 4) to ESP8266 as the controller. HOT 4
- Change Wifi Network HOT 3
- Error compiling mclighting v3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mclighting.