Hi everyone, I really need your help. Okay here's what I'm trying to do , I 'm trying to make use of the PWM pin on the arduino uno to release a output voltage so I can do something with it.
so here's my code so far :
int PWMTDS(float x )
{
float result = x * 0.255;
Serial.println(x);
Serial.println(result);
return result;
}
inside the void loop is like this
float value = PWMTDS(TDS);
Serial.print(" PWM Value for reference:'");
Serial.print(value);
Serial.println("'");
analogWrite(ledPin, value);
delay(30);
in my serial monitor I'm able to see this :
2.86
0.73
PWM Value for reference:'0.00'
2.90
0.74
PWM Value for reference:'0.00'
2.90
0.74
PWM Value for reference:'0.00'
2.92
0.75
PWM Value for reference:'0.00'
I'm safe to assume that my function call is written correctly but how come there's no value at the value for the pwm?