I think the arduino has a built in max/min function. its like constrain(variable, lower bound, upperbound);. ie. constrain(i,0,255);.
確定! 回上一頁