Instead of x equalling to 1, is there a way to make x equal to 1.75? I looked at float on the reference page but couldn't quite make sense of it. Can anyone help please?
void loop()
{
int x = 1;
for (int i = 0; i > -1; i = i + x){
analogWrite(PWMpin, i);
if (i == 255) x = -1; // switch direction at peak
delay(10);
}
}
My bad, forget that example then. Basically increase the speed and decrease the speed of a motor but at a decimal value but not a whole number if that's possible?