did it in software.. but now when u said it, i should try it without the offset part.
f and fn.. yaa i tried everything nothing fix now.. but it seemed to look nice with 0.99 and 1.5.
and here the code in the loop:
void loop() {
//soundn = analogRead(A0);
soundn = abs( analogRead(A0) - 400);
sound = soundn;
soundn = 0;
//int soundn=analogRead(A0);
if (soundn < (sound * f))
soundn = (sound * f);
if (soundn > (sound * fn))
soundn = (sound * fn);
//int lvl = soundn / 28;
int lvl = map(soundn, 0, 700, 0, 38);
for (int thisLed = 0; thisLed < 38; thisLed+=1)
{
if (lvl > thisLed) {
strip.setLEDcolor(thisLed, RED);
}
else {
strip.setLEDcolor(thisLed,GREEN);
}
}
strip.writeStrip();
}