Invalid pin error for reading LDR value


It is invalid pin. It should be A0 is stead of 0.
response = mybolt.analogRead("A0")
I hope this works.

Hi @moulidharb ,
analogRead only works with pin A0, the only analog pin on the Bolt. Any other pin is Invalid. Analog pin A0 is the only pin that can measure voltage levels between 0V-1V on your Bolt. Digital pins can measure only 2 states, HIGH OR 1 (above a certain voltage level, near 3.3V) or LOW OR 0 (below a certain voltage level, near 0V). So correct code would be,
response = mybolt.analogRead('A0')