STM32F407 discovery ADC example

Hi to all.

I upload ADC example from Zerynth documentation:

import streams
import adc # import the adc module

#create a serial port stream with default parameters

while True:

#read the input on analog pin 0
sensor_value =

#convert the analog reading (which goes from 0 - 4095.0) to a voltage (0 - 3.3V):
voltage = sensor_value * (3.3 / 4095.0)

#print out the raw and converted values:
print("sensor raw value:", sensor_value,"Voltage:",voltage)


I connect small photo cell from garden lamp on adc0 (PCA0) pin, but when I change light
intensity on photo cell I always have same reading on adc. What is the problem?

online java validator

In this board, A0 is D65, are you connecting the correct pin?

Do You have pin mapping sheet which connects
pins (A0, A1 ect.) with pins (D65…ect.)?

Now my ADC example works when I connect physically pin D65 on
pot wiper.


Yes, But I think its easier to try accessing the digital pins :
sensor_value =
Let me know if this works.