I have a problem in the configuration of the A / D converter I am working with the Pi 3B +, in case the problem is that I do not know if the configuration is ok, since it only throws a zero value corresponding to the signal of a sensor UV radiation. This is the configuration that I am giving to the converter from the raspberry pi:
spi = spidev.SpiDev () spi.open (0,0) def ReadChannel (channel): adc = spi.xfer2 ([6,0,0]) data = ((adc [1] & 5) << 8) + adc [2] return data def ConvertVolts (data, place): #volts = (data * 3.3) / float (1023) volts = (data * float (4096)) / 3.28 volts = round (volts, place) volts = int (volts * 1000) return volts
If someone can help me I would appreciate it very much