About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

Using ADC Pi Plus with Mono

1287 Views - Created 22/07/2016

22/07/2016

Posted by:
nfhofmann

Users Avatar

Hi, i am using the ADC PI Plus to read samples from an external joystick.

The code in C works very well. But my program is completely in c#.

My question:

how can i use the function <read_voltage(....)> from ABE_ADCPi.h in mono ?

many thanks in advance

Norbert

22/07/2016

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

Hi

I don't have any experience with using mono on the Raspberry Pi so I am affraid I do not know how you would integrate a c library into a c# application.

We do have a Windows 10 IOT version of the ADC Pi library that is written in C# which you may be able to modify to run under mono.  You will need to make a few modifications as the library is designed to use the Windows 10 I2C classes, these will need to be replaced with a mono I2C library.  After a bit of searching around google I found a Raspberry Pi IO library that supports I2C so it should be possible to modify the ADC Pi library to use that instead for accessing the I2C bus.

The ADC Pi library uses a seperate ABE_Helpers.cs class for accessing the I2C bus.  If you can modify the four I2C read and write methods at the bottom of the class to use the mono I2C library instead then you should not need to do any other modifcations on the ADC Pi library.

AB Electronics UK Tech Support

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.