Giter Club home page Giter Club logo

adafruit_ads1x15_rpi's Introduction

Adafruit_ADS1X15_RPi

Adafruit's ADS1X15 C++ library is compatible with various Arduinos. This fork modifies the library to be compatible with Raspberry Pi by using the wiringPi library to do the i2c communications instead of Arduino's wiring.h library. Note that there already exists an ADS1X15 Python library for RPi written by Adafruit: https://github.com/adafruit/Adafruit_Python_ADS1x15. In my case I needed to integrate the library with other C++ code so I made this fork.

[Tested on Raspberry Pi Zero W running Raspbian Jessie]

Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Install wiringPi: http://wiringpi.com/download-and-install/

Enable RPi's SPI and I2C interfaces:

sudo raspi-config
# then go to "Interfacing Options"
# and enable SPI and I2C

Installing

Clone this repository:

cd ~
git clone https://github.com/hallgrimur1471/Adafruit_ADS1X15_RPi.git

Now compile, say, the differential_rpi.c example:

cd ~/Adafruit_ADS1X15_RPi
g++ -W -lwiringPi -o differential_rpi examples/differential_rpi.c Adafruit_ADS1015.cpp

And run it:

./differential_rpi

The program should now output ADS1X15's measurements.

Note that the differential_rpi.c example assumes you have the ADS1X15 circuit wired for differential measurements (see https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/signal-connections).

Original README.md from fork's origin:

Adafruit_ADS1015

Driver for TI's ADS1015: 12-bit Differential or Single-Ended ADC with PGA and Comparator

Compatibility

MCU Tested Works Doesn't Work Not Tested Notes
Atmega328 @ 16MHz X
Atmega328 @ 12MHz X
Atmega32u4 @ 16MHz X Use SDA/SCL on pins D2 & D3
Atmega32u4 @ 8MHz X Use SDA/SCL on pins D2 & D3
ESP8266 X SDA/SCL default to pins 4 & 5 but any two pins can be assigned as SDA/SCL using Wire.begin(SDA,SCL)
Atmega2560 @ 16MHz X Use SDA/SCL on pins 20 & 21
ATSAM3X8E X Use SDA/SCL on pins 20 & 21
ATSAM21D X
ATtiny85 @ 16MHz X Use 0 for SDA, 2 for SCL
ATtiny85 @ 8MHz X Use 0 for SDA, 2 for SCL
Intel Curie @ 32MHz X
STM32F2 X
  • ATmega328 @ 16MHz : Arduino UNO, Adafruit Pro Trinket 5V, Adafruit Metro 328, Adafruit Metro Mini
  • ATmega328 @ 12MHz : Adafruit Pro Trinket 3V
  • ATmega32u4 @ 16MHz : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0
  • ATmega32u4 @ 8MHz : Adafruit Flora, Bluefruit Micro
  • ESP8266 : Adafruit Huzzah
  • ATmega2560 @ 16MHz : Arduino Mega
  • ATSAM3X8E : Arduino Due
  • ATSAM21D : Arduino Zero, M0 Pro
  • ATtiny85 @ 16MHz : Adafruit Trinket 5V
  • ATtiny85 @ 8MHz : Adafruit Gemma, Arduino Gemma, Adafruit Trinket 3V

adafruit_ads1x15_rpi's People

Contributors

hallgrimur1471 avatar andydoro avatar tdicola avatar 11011100 avatar toddtreece avatar

Stargazers

Marwan Fawzy Shahat Mahmoud avatar Vincent avatar Anton Levin avatar  avatar  avatar keet avatar taicho-nv avatar Harry avatar Guillermo avatar  avatar David avatar  avatar Elwood Downey avatar Trevor McDonald avatar Yazzzzzchan avatar Kris Temmerman avatar Tomáš Vítek avatar AndiB avatar HKJeon avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.