Why is the maximum possible value of the analogWrite()
function 255 starting from 0?
But how come the light monitoring system can show data values from 0 upto 1023(1.02thousand) ,i.e., 2^10?
In arduino, ADC(analogRead) is 10bit and PWM timer (analogWrite) is 8 bit. may be this device also come with 10 bit ADC and 8 bit PWM timer. so when we convert 10 bit it become 0-1023. Please someone clarify
1 Like
I think the data in the photos are for the ESP8266EX model, but the model we got is ESP8266 only
@A.K.N
analogWrite() function is for A0 pin which is a 8 bit pin and total range can be found using the formula
2^8 =256 (it can take 256 values)and since we start from 0 so last value will be 255.