update zauberstab.cpp

Signed-off-by: Thomas Schmid <tom@binary-kitchen.de>
This commit is contained in:
Thomas 2022-06-18 23:03:19 +02:00 committed by Thomas Schmid
parent 9bc47656cd
commit 10f616582c
1 changed files with 5 additions and 3 deletions

View File

@ -10,12 +10,14 @@ static uint16_t read_mic() {
}
int zauberstab_init() {
FastLED.addLeds<WS2812, LED_PIN, RGB>(leds, NUM_LEDS);
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
//FastLED.setMaxPowerInVoltsAndMilliamps(5, 300);
dc_cancelation_init(&dc_blocker, 0.95);
return 0;
}
float get_sample() {
int32_t raw_sample = read_mic();
return dc_cancelation_update(&dc_blocker, (float) raw_sample);
float sample = read_mic();
sample = dc_cancelation_update(&dc_blocker, sample);
return sample;
}