Skip to content

Commit

Permalink
fix typos + minor edits (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart authored Jan 2, 2024
1 parent 1fd2fd3 commit 7ad1382
Show file tree
Hide file tree
Showing 26 changed files with 170 additions and 165 deletions.
4 changes: 2 additions & 2 deletions ADS1X15.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// FILE: ADS1X15.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.4.0
// VERSION: 0.4.1
// DATE: 2013-03-24
// PUPROSE: Arduino library for ADS1015 and ADS1115
// PURPOSE: Arduino library for ADS1015 and ADS1115
// URL: https://github.com/RobTillaart/ADS1X15


Expand Down
17 changes: 9 additions & 8 deletions ADS1X15.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
//
// FILE: ADS1X15.h
// AUTHOR: Rob Tillaart
// VERSION: 0.4.0
// VERSION: 0.4.1
// DATE: 2013-03-24
// PUPROSE: Arduino library for ADS1015 and ADS1115
// PURPOSE: Arduino library for ADS1015 and ADS1115
// URL: https://github.com/RobTillaart/ADS1X15
//


#include "Arduino.h"
#include "Wire.h"

#define ADS1X15_LIB_VERSION (F("0.4.0"))
#define ADS1X15_LIB_VERSION (F("0.4.1"))

// allow compile time default address
// address in { 0x48, 0x49, 0x4A, 0x4B }, no test...
Expand Down Expand Up @@ -64,16 +64,16 @@ class ADS1X15
// 0 = slowest
// 7 = fastest
// 4 = default
void setDataRate(uint8_t dataRate = 4); // invalid values are mapped on 4 (default)
uint8_t getDataRate(); // actual speed depends on device
void setDataRate(uint8_t dataRate = 4); // invalid values are mapped on 4 (default)
uint8_t getDataRate(); // actual speed depends on device


int16_t readADC(uint8_t pin = 0);
int16_t readADC_Differential_0_1();

// used by continuous mode and async mode.
[[deprecated("Use getValue() instead")]]
int16_t getLastValue() { return getValue(); }; // will be obsolete in the future 0.4.0
int16_t getLastValue() { return getValue(); }; // will be obsolete in the future 0.4.0
int16_t getValue();


Expand Down Expand Up @@ -126,8 +126,9 @@ class ADS1X15
// EXPERIMENTAL
// see https://github.com/RobTillaart/ADS1X15/issues/22
void setWireClock(uint32_t clockSpeed = 100000);
// proto - getWireClock returns the value set by setWireClock
// not necessary the actual value
// prototype
// - getWireClock returns the value set by setWireClock
// not necessary the actual value
uint32_t getWireClock();


Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.4.1] - 2024-01-02
- fix some typos
- minor edits


## [0.4.0] - 2023-12-06
- refactor API, begin()
- update readme.md
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2013-2023 Rob Tillaart
Copyright (c) 2013-2024 Rob Tillaart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 4 additions & 2 deletions examples/ADS_1114_four/ADS_1114_four.ino
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ void loop()
// we have all values, so process (print) them
ADS_print_all();

delay(1000); // wait a second, comment this line for more samples.
// wait a second, comment this line for more samples.
delay(1000);
ADS_request_all();
}

Expand All @@ -65,7 +66,8 @@ void ADS_request_all()
for (int i = 0; i < 4; i++)
{
if (ADS[i].isConnected()) ADS[i].requestADC(0);
delayMicroseconds(200); // get them evenly spaced in time ...
// get them evenly spaced in time ...
delayMicroseconds(200);
}
}

Expand Down
12 changes: 6 additions & 6 deletions examples/ADS_RP2040_WIRE1/ADS_RP2040_WIRE1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
#include "ADS1X15.h"


// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
ADS1115 ADS(0x48, &Wire1);


Expand Down
11 changes: 6 additions & 5 deletions examples/ADS_async_16_channel/ADS_async_16_channel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
// URL: https://github.com/RobTillaart/ADS1X15


// Note all IO with the sensors are guarded by an isConnected()
// this is max robust, in non critical application one may either
// cache the value or only verify it in setup (least robust).
// Less robust may cause the application to hang - watchdog reset ?
// Note all IO with the sensors are guarded by an isConnected()
// this is max robust, in non critical application one may either
// cache the value or only verify it in setup (least robust).
// Less robust may cause the application to hang - watchdog reset ?


#include "ADS1X15.h"
Expand Down Expand Up @@ -55,7 +55,8 @@ void loop()
// we have all values
ADS_print_all();

delay(1000); // wait a second.
// wait a second.
delay(1000);
ADS_request_all();
}

Expand Down
16 changes: 8 additions & 8 deletions examples/ADS_async_8_channel/ADS_async_8_channel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
// URL: https://github.com/RobTillaart/ADS1X15


// Note all IO with the sensors are guarded by an isConnected()
// this is max robust, in non critical application one may either
// cache the value or only verify it in setup (least robust).
// Less robust may cause the application to hang - watchdog reset ?
// Note all IO with the sensors are guarded by an isConnected()
// this is max robust, in non critical application one may either
// cache the value or only verify it in setup (least robust).
// Less robust may cause the application to hang - watchdog reset ?


#include "ADS1X15.h"


ADS1115 ADS0(0x48);
ADS1115 ADS1(0x49);
//ADS1115 ADS2(0x4A);
//ADS1115 ADS3(0x4B);
// ADS1115 ADS2(0x4A);
// ADS1115 ADS3(0x4B);

int16_t val0[4] = { 0, 0, 0, 0 };
int16_t val1[4] = { 0, 0, 0, 0 };
//int16_t val2[4] = { 0, 0, 0, 0 };
//int16_t val3[4] = { 0, 0, 0, 0 };
// int16_t val2[4] = { 0, 0, 0, 0 };
// int16_t val3[4] = { 0, 0, 0, 0 };
int idx = 0;

uint32_t lastTime = 0;
Expand Down
29 changes: 14 additions & 15 deletions examples/ADS_async_differential/ADS_async_differential.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,25 @@
// PURPOSE: read multiple differential continuously
// URL: https://github.com/RobTillaart/ADS1X15

// test
// connect 4 potmeters
// test
// connect 4 potmeters
//
// GND ---[ x ]------ 5V
// |
//
// measure at x - connect to AIN0..4.
// GND ---[ x ]------ 5V
// |
//
// measure at x - connect to AIN0..4.
//


#include "ADS1X15.h"


// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
ADS1115 ADS(0x48);


Expand All @@ -45,7 +44,7 @@ void setup()
ADS.setGain(0); // 6.144 volt
ADS.setDataRate(4); // 0 = slow 4 = medium 7 = fast

// single shot mode
// single shot mode
ADS.setMode(1);
// start with first pair
pair = 01;
Expand All @@ -65,7 +64,7 @@ void loop()
Serial.println();
}

// do other stuff here
// do other stuff here
delay(10);
}

Expand All @@ -80,7 +79,7 @@ bool handleConversion()
val_01 = ADS.getValue();
pair = 23;
ADS.requestADC_Differential_2_3();
return false; // only one done
return false; // only one done
}

// last of series to check
Expand Down
12 changes: 6 additions & 6 deletions examples/ADS_continuous/ADS_continuous.ino
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#include "ADS1X15.h"


// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
ADS1115 ADS(0x48);

uint16_t count = 0;
Expand Down
18 changes: 10 additions & 8 deletions examples/ADS_continuous_3_channel/ADS_continuous_3_channel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
//
// experimental, not tested extensively

// test
// connect multiple potmeters
// test
// connect multiple potmeters
//
// RDY ----------------- pin 2 (for IRQ)
//
Expand All @@ -29,12 +29,12 @@
#include "ADS1X15.h"


// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
ADS1115 ADS(0x48);

volatile bool RDY = false;
Expand Down Expand Up @@ -119,4 +119,6 @@ void adsReady()
RDY = true;
}


// -- END OF FILE --

26 changes: 13 additions & 13 deletions examples/ADS_continuous_4_channel/ADS_continuous_4_channel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
// interrupt driven to catch all conversions.
// URL: https://github.com/RobTillaart/ADS1X15

// test
// connect multiple potmeters
// test
// connect multiple potmeters
//
// GND ---[ x ]------ 5V
// |
// GND ---[ x ]------ 5V
// |
//
// measure at x - connect to AIN0..4.
// measure at x - connect to AIN0..4.
//
// for the test it is good to have AIN3 connected to 5V and AIN4 to GND
// so one can see these as references in the output.
// for the test it is good to have AIN3 connected to 5V and AIN4 to GND
// so one can see these as references in the output.
//


#include "ADS1X15.h"


// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
// choose your sensor
// ADS1013 ADS(0x48);
// ADS1014 ADS(0x48);
// ADS1015 ADS(0x48);
// ADS1113 ADS(0x48);
// ADS1114 ADS(0x48);
ADS1115 ADS(0x48);

volatile bool RDY = false;
Expand Down
14 changes: 7 additions & 7 deletions examples/ADS_continuous_8_channel/ADS_continuous_8_channel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
// interrupt driven to catch all conversions.
// URL: https://github.com/RobTillaart/ADS1X15

// test
// connect multiple potmeters to 2 ADS1115
// test
// connect multiple potmeters to 2 ADS1115
//
// GND ---[ x ]------ 5V
// |
// GND ---[ x ]------ 5V
// |
//
// measure at x - connect to AIN0..4.
// measure at x - connect to AIN0..4.
//
// for the test it is good to have AIN3 connected to 5V and AIN4 to GND
// so one can see these as references in the output.
// for the test it is good to have AIN3 connected to 5V and AIN4 to GND
// so one can see these as references in the output.
//


Expand Down
Loading

0 comments on commit 7ad1382

Please sign in to comment.