Skip to content

Commit

Permalink
Start adding example of connecting to WLED audio data
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Oct 13, 2023
1 parent 30b8bf5 commit e5435b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usermods/usermod_v2_audiolux/usermod_v2_audiolux.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class WLEDAudioInput : public Input {
float getInput(int index = 0) {
if (index == 0) {
uint8_t samplePeak = *(uint8_t*)um_data->u_data[3];
return 0.0; // TODO map 0-255 to expected range
return map((samplePeak * 4), 0 1020, 0, 1000) / 1000;
} else if (index == 1) {
uint8_t *fftResult = (uint8_t*) um_data->u_data[2];
return 0.0; // TODO map 0-255 to expected range
return 0.0; // TODO map 0-255 to expected range - https://github.com/netmindz/Audiolux/blob/81056ab8f59cb4a801b541ba57a62786b4b93a73/msgeq7.cpp#L39
} else {
return 0.0;
}
Expand Down

0 comments on commit e5435b6

Please sign in to comment.