Johan_Ha:
Just take care that you change each negative value to 0 before outputting it. A negative value just becomes another positive value. val + 256 or something similar. Better set it to zero.
How do you think I'd go about doing that?
I'm thinking maybe an if and if else statement would work, but I'm not sure what variable/argument to put in it.
Something like:
if(frequency < 0){
frequency = 0;
}
Or maybe use the "constrain" command? Although I'm not sure how it works. It's what I just see online.