main: drop pulse input in favor of existing BPM, add to default config
This commit is contained in:
parent
d824dbfa45
commit
ea058a33da
@ -1,15 +1,24 @@
|
|||||||
{
|
{
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"tasks": [
|
"tasks": [
|
||||||
|
"Power",
|
||||||
"Renderer",
|
"Renderer",
|
||||||
"MQTT",
|
"U8Display",
|
||||||
"WiFi",
|
"WiFi",
|
||||||
|
"MQTT",
|
||||||
"ArduinoOTA",
|
"ArduinoOTA",
|
||||||
"UpdateStatusAnimation"
|
"BPM"
|
||||||
],
|
],
|
||||||
"scenes": {
|
"scenes": {
|
||||||
"Idle": ["Solid", "MPU5060", "Pulse", "IdleColors", "CircadianRhythm"],
|
"Idle": ["Solid", "MPU5060", "IdleColors", "CircadianRhythm"],
|
||||||
"Flashlight": ["Flashlight"]
|
"Flashlight": ["Flashlight"]
|
||||||
},
|
},
|
||||||
"surfaceMap": "default"
|
"surfaceMap": "default",
|
||||||
|
"logLevel": 6,
|
||||||
|
"defaults": {
|
||||||
|
"mqtt.ip": "10.0.0.2",
|
||||||
|
"power.milliamps": 500,
|
||||||
|
"power.volts": 5,
|
||||||
|
"bpm.idle": 75
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
19
src/main.cpp
19
src/main.cpp
@ -34,24 +34,6 @@ Display dpy(leds, HardwareConfig::MAX_LED_NUM, Static<ConfigService>::instance()
|
|||||||
}
|
}
|
||||||
});*/
|
});*/
|
||||||
|
|
||||||
InputFunc randomPulse([]() {
|
|
||||||
static unsigned int pulse = 0;
|
|
||||||
EVERY_N_MILLISECONDS(25) {
|
|
||||||
if (pulse == 0) {
|
|
||||||
pulse = random(25) + 25;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (pulse > 0) {
|
|
||||||
if (random(255) >= 25) {
|
|
||||||
pulse--;
|
|
||||||
return InputEvent{InputEvent::Acceleration, beatsin16(60 * 8, 0, 4972)};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return InputEvent{};
|
|
||||||
}, "Pulse");
|
|
||||||
|
|
||||||
REGISTER_TASK(randomPulse);
|
|
||||||
|
|
||||||
InputMapper keyMap([](const InputEvent& evt) {
|
InputMapper keyMap([](const InputEvent& evt) {
|
||||||
if (evt.intent == InputEvent::UserInput) {
|
if (evt.intent == InputEvent::UserInput) {
|
||||||
Buttons::Chord chord = (Buttons::Chord)evt.asInt();
|
Buttons::Chord chord = (Buttons::Chord)evt.asInt();
|
||||||
@ -74,7 +56,6 @@ InputMapper keyMap([](const InputEvent& evt) {
|
|||||||
|
|
||||||
REGISTER_TASK(keyMap);
|
REGISTER_TASK(keyMap);
|
||||||
|
|
||||||
|
|
||||||
// Cycle some random colors
|
// Cycle some random colors
|
||||||
ColorSequenceInput<9> idleCycle{{
|
ColorSequenceInput<9> idleCycle{{
|
||||||
CRGB(0, 123, 167), // Cerulean
|
CRGB(0, 123, 167), // Cerulean
|
||||||
|
Loading…
Reference in New Issue
Block a user