Automation Hat slave register address


#1

Hello,

Does anyone know the slave register address for the ADC (1,2,3)?
I am connecting using simulink and am presented with this box:
New photo by Michael Jenkins

Thank you.


#3

You should read page 23 of this datasheet: http://www.ti.com/lit/ds/symlink/ads1015.pdf

And probably glance over the Python code: https://github.com/pimoroni/automation-hat/blob/master/library/automationhat/ads1015.py

The ADS1015 on Automation HAT can’t be directly read- it must be configured and complete an integration cycle before a valid reading is present.


#6

I pasted the initialization example model from typing raspberrypi_I2C_temp_init into Matlab into my project.
The model is mentioned in this help article:
https://www.mathworks.com/help/releases/R2018a/supportpkg/raspberrypi/examples/read-temperature-from-a-tmp102-sensor.html

Go down into the submodel of “Configure TMP102 for Extended Mode” and change the value in the “Write to the Configuration Register”.
I changed the value of hex2dec(‘60B0’) to hex2dec(‘1’) and I was successfully able to read 5 volts through the ADC channel 2
I had to scale it using a gain value of -1/720.


#7

Glad you’re up and running, looks like you had quite the journey!