SPRING SALE up to 20% OFF! (excludes trade customers)  •  FREE Standard Delivery for orders over £35 (ex VAT)
Knowledge Base

The AB Electronics UK Knowledge Base provides support solutions, tutorials and troubleshooting guides.

Knowledge Base

ADC Differential Pi C Library

ADC Differential Pi C Library Installation and Usage

Created 29/07/2024 | Last Updated: 30/07/2024

YOU WILL NEED THIS BOARD

48 available
Order a ADC Differential Pi Photo of ADC Differential Pi

ADC Differential Pi

8 Channel 18-bit Differential Analogue to Digital converter development board for the Raspberry Pi

£13.59 ex VAT

View Product

C Library to use with ADC Differential Pi Raspberry Pi development board.

The example C programs can be found in /ABElectronics_C_Libraries/ADCDifferetialPi/demos

Downloading and Installing the library

To download to your Raspberry Pi type in the terminal:

git clone https://github.com/abelectronicsuk/ABElectronics_C_Libraries.git

Functions

read_raw(uint8_t address, uint8_t channel, uint8_t bitrate, uint8_t pga,	uint8_t conversionmode)

Reads the raw value from the selected ADC channel
Parameter: (uint8_t) address - I2C address for the target device e.g. 0x68
Parameter: (uint8_t) channel - 1 to 4
Parameter: (uint8_t) bitrate - 12, 14, 16 or 18
Parameter: (uint8_t) pga - 1, 2, 4 or 8
Parameter: (uint8_t) conversionmode - 0 = one shot conversion, 1 = continuous conversion
Returns: (uint32_t) value from ADC buffer


read_voltage(uint8_t address, uint8_t channel, uint8_t bitrate, uint8_t pga, uint8_t conversionmode);

Reads the voltage from the selected ADC channel
Parameter: (uint8_t) address - I2C address for the target device e.g. 0x68
Parameter: (uint8_t) channel - 1 to 4
Parameter: (uint8_t) bitrate - 12, 14, 16 or 18
Parameter: (uint8_t) pga - 1, 2, 4 or 8
Parameter: (uint8_t) conversionmode - 0 = one shot conversion, 1 = continuous conversion
Returns: (double) voltage value from ADC

Also useful for your Raspberry Pi project

Temperature & Sensing

1 Wire Pi Plus

Connect dozens of 1-Wire sensors - temperature, iButtons, EEPROMs - via a single GPIO pin. Stacks directly on the 40-pin header.

£9.59 ex VAT

Analogue I/O

ADC Pi

Read up to 8 analogue inputs - perfect for pairing with your temperature sensors or other analogue-output devices.

£14.39 ex VAT

All-in-one

Expander Pi

Combines ADC, DAC, 32 GPIO ports and a real-time clock on one board. The most versatile board for complex Raspberry Pi projects.

£15.99 ex VAT

Order these Boards

All boards are designed & manufactured in the UK with RoHS-compliant components.

Home

Shop

Learn

Forum

FAQ

Contact