You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a problem from the code but from the hardware itself.
I have a workaround so other people can bypass the issue.
The volume dont reach 100% in computer or if inverted, goes from 100% to like 15%.
Somehow, the output on the console only reach 850. For what i understand, this can be caused by "noise", quality of wires/pot's or even if the arduino cant output exactly 5v (like 4.8v).
I've changed the updateSliderValues() with a map function, it scales the real output value to value that we want. This must be analized case by case and conditions can be needed if not all the outputs give the same real output (Ex. Out1 = 850, Out2 = 1000, Out3 = 500, etc).
void updateSliderValues() {
for (int i = 0; i < NUM_SLIDERS; i++) {
analogSliderValues[i] = analogRead(analogInputs[i]);
// Map the value to the range 0-1000 based on the observed max output
//map([arduino_input], [real_output_min_value], [real_output_max_value], [min_wanted_virtual_value], [max_wanted_virtual_value])
analogSliderValues[i] = map(analogSliderValues[i], 0, 850, 0, 1023);
}
}
Hope that this helps someone
The text was updated successfully, but these errors were encountered:
This is not a problem from the code but from the hardware itself.
I have a workaround so other people can bypass the issue.
The volume dont reach 100% in computer or if inverted, goes from 100% to like 15%.
Somehow, the output on the console only reach 850. For what i understand, this can be caused by "noise", quality of wires/pot's or even if the arduino cant output exactly 5v (like 4.8v).
I've changed the updateSliderValues() with a map function, it scales the real output value to value that we want. This must be analized case by case and conditions can be needed if not all the outputs give the same real output (Ex. Out1 = 850, Out2 = 1000, Out3 = 500, etc).
void updateSliderValues() {
for (int i = 0; i < NUM_SLIDERS; i++) {
analogSliderValues[i] = analogRead(analogInputs[i]);
// Map the value to the range 0-1000 based on the observed max output
//map([arduino_input], [real_output_min_value], [real_output_max_value], [min_wanted_virtual_value], [max_wanted_virtual_value])
analogSliderValues[i] = map(analogSliderValues[i], 0, 850, 0, 1023);
}
}
Hope that this helps someone
The text was updated successfully, but these errors were encountered: