Skip to content

Commit

Permalink
1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
battosai30 committed Jan 25, 2023
1 parent ff0937c commit 077a23a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Examples/MCP3424_Multichannel/MCP3424_Multichannel.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* MCP 3424 version 1.9 example sketch Multichannel
/* MCP 3424 version 1.9.2 example sketch Multichannel
Written by B@tto
Contact : batto@hotmail.fr
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* MCP 3424 version 1.9 example sketch OneShotConversion
/* MCP 3424 version 1.9.2 example sketch OneShotConversion
Written by B@tto
Contact : batto@hotmail.fr
Expand Down
4 changes: 2 additions & 2 deletions MCP342x.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* MCP342x library version 1.9
/* MCP342x library version 1.9.2
Writed by B@tto
Contact : batto@hotmail.fr
Expand Down Expand Up @@ -65,7 +65,7 @@ uint8_t MCP342x::getConfiguration()

}

void MCP342x::setConfiguration(byte channel,RESOLUTION resolution,MEASURE_MODE mode,PGA pga)
void MCP342x::setConfiguration(byte channel,int resolution,int mode,int pga)
{

channel&=0b11;
Expand Down
18 changes: 9 additions & 9 deletions MCP342x.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* MCP342x library version 1.9
/* MCP342x library version 1.9.2
Writed by B@tto
Contact : batto@hotmail.fr
Expand Down Expand Up @@ -35,29 +35,29 @@ Contact : batto@hotmail.fr
#include <Wire.h>
//#include <Math.h>

typedef enum MEASURE_MODE
enum MEASURE_MODE
{
ONE_SHOT_MODE=0,
CONTINUOUS_MODE
};

typedef enum RESOLUTION
enum RESOLUTION
{
RESOLUTION_12_BITS=0,
RESOLUTION_14_BITS,
RESOLUTION_16_BITS,
RESOLUTION_18_BITS
};

typedef enum CHANNELS
enum CHANNELS
{
CH1=0,
CH2,
CH3,
CH4
};

typedef enum PGA
enum PGA
{
PGA_X1=0,
PGA_X2,
Expand All @@ -75,7 +75,7 @@ class MCP342x {
MCP342x(uint8_t adresse);
~MCP342x();
void begin(uint8_t setMod = 1);
void setConfiguration(byte channel,RESOLUTION resolution,MEASURE_MODE mode,PGA pga);
void setConfiguration(byte channel,int resolution,int mode,int pga);
void newConversion();
bool isConversionFinished();
int32_t measure();
Expand All @@ -86,9 +86,9 @@ uint8_t getAddress();
private:

uint8_t _adresse;
RESOLUTION _resolution;
MEASURE_MODE _mode;
PGA _PGA;
int _resolution;
int _mode;
int _PGA;
int32_t _LSB;
uint8_t _buffer[4];

Expand Down
5 changes: 3 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ Contact: batto@hotmail.fr

### Current version ###

1.92
1.9.2

## History ##

- 1.92 06/04/2022 : add some constrain in setConfiguration() to avoid out of index crashes, and add a getAddress() function to get i2c computed real address
- 1.9.2 25/01/2023 : revert back about typedef enum etc ... Caused issues on ESP32
- 1.9.1 06/04/2022 : add some constrain in setConfiguration() to avoid out of index crashes, and add a getAddress() function to get i2c computed real address
- 1.9 27/08/2021 : changed CHANNELS to byte type in setConfiguration()
- 1.8 26/02/2019 : correction for 16-bit platform (bad bit shifting during 18-bits acquisition)
- 1.7 25/07/2019 : support on MCP3421 confirmed, changed to MCP342x. Update examples
Expand Down

0 comments on commit 077a23a

Please sign in to comment.