Skip to main content
1 of 2

there are some issue with map command for example you are reading value from thermistor from A0 which has parameters from 0 to 1023 and after that you use command map() and change this value to 0 - 255 or you want to do this, but the right syntax for this command is "Input = map(analogRead(0), 0, 1023, 0, 255);" but I cant see reason for that because you are reading value 0-1023 and change it to 0-255 and set point is 650 so you never get setpoint because maximum is 255. so try use as input just analogread(0), there si no reason to change input into pwm range and output is for PID library in PWM range as a default so you can send output direct to motor pin, off course use some H-bridge or something like that.