unosquare / raspberryio

The Raspberry Pi's IO Functionality in an easy-to-use API for Mono/.NET/C#
https://unosquare.github.io/raspberryio
Other
672 stars 104 forks source link

How to Use ADS1115 I2C Analog-to-Digital Converter devices #231

Closed DevilK89 closed 3 years ago

DevilK89 commented 3 years ago

Good afternoon,

I would like to know if you have any example of communication with the ADS1115 card, as I am not able to communicate with the card, currently it appears the error id 72 could not be registered with the I2C bus.

Thank you for now.

multisys commented 3 years ago

Hi, I am having the same problem.

multisys commented 3 years ago

DevilK89 please put your code.

ZillionPrey commented 3 years ago

This is the way I'm using the ADS1115:

var mainADC = new Unosquare.RaspberryIO.Peripherals.ADS1115();

while (true)
{
    Console.WriteLine("Raw Voltage: " + mainADC.ReadChannel(0x0)); //Read Channel 1
    Console.WriteLine("Raw Voltage: " + mainADC.ReadChannel(0x1)); //Read Channel 2
    Console.WriteLine("Raw Voltage: " + mainADC.ReadChannel(0x2)); //Read Channel 3
    Console.WriteLine("Raw Voltage: " + mainADC.ReadChannel(0x3)); //Read Channel 4
    Thread.Sleep(1000);
}

Hope this helps :)

geoperez commented 3 years ago

We are looking for a new maintainer, apply at https://adoptoposs.org/p/9f5b74b9-04f2-42b6-891f-c5294c9ef1c5

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.