Skip to content

Conversation

@ochococo
Copy link
Contributor

ADS1119 Arduino Library

🌍 https://github.com/ELOWRO/ADS1119

Usage

Basic:

#include <ADS1119.h>

ADS1119 ads1 = ADS1119(byte(0B1000001));

struct ADS1119Configuration configuration;

void setup() {
  Serial.begin(9600);

  configuration.mux = ADS1119MuxConfiguration::positiveAIN0negativeAIN1;
  configuration.gain = ADS1119Configuration::Gain::one;
  configuration.dataRate  = ADS1119Configuration::DataRate::sps20;
  configuration.conversionMode = ADS1119Configuration::ConversionMode::continuous;
  configuration.voltageReference = ADS1119Configuration::VoltageReferenceSource::external;
  configuration.externalReferenceVoltage = 5.0;

  Serial.println("begin, reset");

  ads1.begin(&configuration);
  /* Config ADS1119 Amux Input as Single Ended*/
  ads1.configADCSingleEnded();
  /* Select ADS1119 Channel
  Single Ended: 4 CHANNELS => AN0, AN1, AN2, AN3
  Differential: 3 CHANNELS => AN0-AN1, AN2-AN3, AN1-AN2, 
  */
  ads1.selectChannel(0); // select AN0 (single ended input mode)
  ads1.reset();

  Serial.println("setup done");
}

void loop() {
   Serial.println(ads1.readVoltage(), 4);
}

Advanced:

#include <ADS1119.h>
#include <avr/wdt.h>

ADS1119 ads1 = ADS1119(byte(0B1000001));

struct ADS1119Configuration configuration;

void setup() {
  Serial.begin(9600);
  
  configuration.mux = ADS1119MuxConfiguration::positiveAIN0negativeAIN1;
  configuration.gain = ADS1119Configuration::Gain::one;
  configuration.dataRate  = ADS1119Configuration::DataRate::sps20;
  configuration.conversionMode = ADS1119Configuration::ConversionMode::continuous;
  configuration.voltageReference = ADS1119Configuration::VoltageReferenceSource::external;
  configuration.externalReferenceVoltage = 5.0;

  Serial.println("begin, reset");

  ads1.begin(&configuration);
  /* Config ADS1119 Amux Input as Single Ended*/
  ads1.configADCSingleEnded();
  /* Select ADS1119 Channel
  Single Ended: 4 CHANNELS => AN0, AN1, AN2, AN3
  Differential: 3 CHANNELS => AN0-AN1, AN2-AN3, AN1-AN2, 
  */
  ads1.selectChannel(0); // select AN0 (single ended input mode)
  ads1.reset();
  // Offset Calibration: VREF connected to AIN2 !!!
  // ads1.performOffsetCalibration(ADS1119MuxConfiguration::positiveAIN2negativeAGND);
  // Offset Calibration: shorting the inputs to AVDD / 2 !!!
  ads1.performOffsetCalibration(ADS1119MuxConfiguration::shortedToHalvedAVDD);
  wdt_enable(WDTO_2S);
  Serial.println("setup done");
}

void loop() {
   wdt_reset();
   Serial.println(ads1.readVoltage(configuration), 4);
   //ads.powerDown();
}

@github-actions
Copy link
Contributor

A problem was found with your submission https://github.com/ELOWRO/ADS1119

ERROR: The repository has no tags. You need to create a release or tag that matches the version value in the library's library.properties file.

@github-actions github-actions bot added the topic: submission Add library to the list label Dec 29, 2024
@github-actions
Copy link
Contributor

Thanks for your interest in contributing to the Arduino Library Manager index @ochococo
Please resolve the error(s) mentioned in the previous comment.

After resolving the issue, trigger this check again by doing one of the following:

  • Commit the required change to the branch you submitted this pull request from.
  • Comment here, mentioning @ArduinoBot in the comment.

NOTE: It is not necessary to open a new pull request. ❗

More information:
https://github.com/arduino/library-registry/blob/main/README.md#if-the-problem-is-with-the-pull-request

@ochococo
Copy link
Contributor Author

@ArduinoBot Tag is there

@github-actions
Copy link
Contributor

Hello! I'm checking your submission again.

@github-actions
Copy link
Contributor

Arduino Lint has suggestions for possible improvements to https://github.com/ELOWRO/ADS1119:

Linting library in ADS1119
INFO: No header file found matching library name (ADS1119_library.h). Best practices are for primary header filename to 
      match library name.                                                                                               
      See: https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format            
      (Rule LS008)                                                                                                      
WARNING: library.properties name ADS1119 library contains spaces. Although supported, best practices is to not use      
         spaces.                                                                                                        
         See: https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format         
         (Rule LP015)                                                                                                   
WARNING: Library name ADS1119 library contains "library". This is superfluous.                                 
         See: https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format
         (Rule LP016)                                                                                          
WARNING: library.properties depends field item(s) Wire not found in the Library Manager index.                 
         See: https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format
         (Rule LP048)                                                                                          
WARNING: No example sketches found. Please provide examples.                                      
         See: https://arduino.github.io/arduino-cli/latest/library-specification/#library-examples
         (Rule LD004)                                                                             

Linter results for project: 0 ERRORS, 4 WARNINGS

-------------------

@github-actions github-actions bot merged commit 615f51d into arduino:main Dec 29, 2024
12 checks passed
@github-actions
Copy link
Contributor

Your submission has now been accepted! Thanks for your contribution to the Arduino Library Manager index.

The library(s) will be available for installation via Library Manager within a day's time.

You can check the logs from the Library Manager indexer for your library(s) here:
http://downloads.arduino.cc/libraries/logs/github.com/ELOWRO/ADS1119/

github-actions bot pushed a commit that referenced this pull request Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: submission Add library to the list

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant