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
streams.serial()

while True:

#read the input on analog pin 0
sensor_value = adc.read(A0)

#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)

sleep(300)

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?

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

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

BR
IvanJ

Yes, But I think its easier to try accessing the digital pins :
sensor_value = adc.read(D65.ADC)
Let me know if this works.