mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.5.0 MCP_ADC
This commit is contained in:
parent
19bc3e5f2e
commit
034111d65f
@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.5.0] - 2024-01-20
|
||||
- Fix #22, improve handling SPI dependency.
|
||||
- update examples
|
||||
|
||||
----
|
||||
|
||||
## [0.4.0] - 2023-12-18
|
||||
- fix #18, support for Arduino ESP32 S3 - breaking change
|
||||
- update examples
|
||||
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019-2023 Rob Tillaart
|
||||
Copyright (c) 2019-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
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: MCP_ADC.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.4.0
|
||||
// VERSION: 0.5.0
|
||||
// DATE: 2019-10-24
|
||||
// PURPOSE: Arduino library for MCP3001, MCP3002, MCP3004, MCP3008, MCP3201, MCP3202, MCP3204, MCP3208
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
@ -46,8 +46,8 @@ void MCP_ADC::begin(uint8_t select)
|
||||
|
||||
if (_hwSPI)
|
||||
{
|
||||
_mySPI->end();
|
||||
_mySPI->begin();
|
||||
// _mySPI->end();
|
||||
// _mySPI->begin();
|
||||
}
|
||||
else // software SPI
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: MCP_ADC.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.4.0
|
||||
// VERSION: 0.5.0
|
||||
// DATE: 2019-10-24
|
||||
// PURPOSE: Arduino library for MCP3001, MCP3002, MCP3004, MCP3008, MCP3201, MCP3202, MCP3204, MCP3208
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
@ -18,7 +18,7 @@
|
||||
#include "SPI.h"
|
||||
|
||||
|
||||
#define MCP_ADC_LIB_VERSION (F("0.4.0"))
|
||||
#define MCP_ADC_LIB_VERSION (F("0.5.0"))
|
||||
|
||||
|
||||
#ifndef __SPI_CLASS__
|
||||
|
@ -45,6 +45,13 @@ Build into the library is a delta mode which is a software enhanced differential
|
||||
This delta mode can return negative values too.
|
||||
|
||||
|
||||
#### 0.5.0 Breaking change
|
||||
|
||||
Version 0.5.0 introduced a breaking change to improve handling the SPI dependency.
|
||||
The user has to call **SPI.begin()** or equivalent before calling **MCP.begin()**.
|
||||
Optionally the user can provide parameters to the **SPI.begin(...)**
|
||||
|
||||
|
||||
#### 0.4.0 Breaking change
|
||||
|
||||
The version 0.4.0 has breaking changes in the interface.
|
||||
|
@ -2,11 +2,12 @@
|
||||
// FILE: MCP3002_analogRead.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo
|
||||
// DATE: 2020-08-13
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
|
||||
|
||||
MCP3002 mcp1; // use HWSPI
|
||||
MCP3002 mcp2(6, 7, 8); // use SWSPI
|
||||
|
||||
@ -18,6 +19,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp1.begin(10);
|
||||
mcp2.begin(5);
|
||||
|
||||
|
@ -2,11 +2,12 @@
|
||||
// FILE: MCP3002_deltaRead.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo
|
||||
// DATE: 2020-08-13
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
|
||||
|
||||
MCP3002 mcp1; // use HWSPI
|
||||
MCP3002 mcp2(6, 7, 8); // use SWSPI
|
||||
|
||||
@ -18,6 +19,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp1.begin(10);
|
||||
mcp2.begin(5);
|
||||
|
||||
|
@ -2,11 +2,12 @@
|
||||
// FILE: MCP3002_differentialRead.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo
|
||||
// DATE: 2020-08-13
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
|
||||
|
||||
MCP3002 mcp1; // use HWSPI
|
||||
MCP3002 mcp2(6, 7, 8); // use SWSPI
|
||||
|
||||
@ -18,6 +19,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp1.begin(10);
|
||||
mcp2.begin(5);
|
||||
|
||||
|
@ -2,11 +2,12 @@
|
||||
// FILE: MCP3008_analogRead.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo
|
||||
// DATE: 2020-08-13
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
|
||||
|
||||
MCP3008 mcp1; // use HWSPI
|
||||
MCP3004 mcp2(6, 7, 8); // use SWSPI
|
||||
|
||||
@ -18,6 +19,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp1.begin(10);
|
||||
mcp2.begin(5);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// FILE: MCP3008_analogRead_ESP32_HWSPI.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo
|
||||
// DATE: 2021-03-12
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
@ -33,6 +33,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp1.begin(5); // chip select pin.
|
||||
|
||||
Serial.println();
|
||||
|
@ -2,7 +2,7 @@
|
||||
// FILE: MCP3008_analogRead_ESP32_SWSPI.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo
|
||||
// DATE: 2021-03-12
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
@ -32,6 +32,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp1.begin(5);
|
||||
|
||||
Serial.println();
|
||||
|
@ -2,7 +2,7 @@
|
||||
// FILE: MCP3008_deltaRead.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo
|
||||
// DATE: 2020-08-13
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
@ -18,6 +18,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp1.begin(10);
|
||||
mcp2.begin(5);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// FILE: MCP3008_differentialRead.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo
|
||||
// DATE: 2020-08-13
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
@ -18,6 +18,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp1.begin(10);
|
||||
mcp2.begin(5);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// FILE: MCP3201_analogRead.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo
|
||||
// DATE: 2023-08-15
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
@ -19,6 +19,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp1.begin(10);
|
||||
mcp2.begin(5);
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
// FILE: MCP3208_performance.ino
|
||||
// AUTHOR: Rob Tillaart, Alex Uta
|
||||
// PURPOSE: simple performance measurement for MCP3208
|
||||
// DATE: 2023-08-13
|
||||
//
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
|
||||
|
||||
#include "MCP_ADC.h"
|
||||
|
||||
|
||||
MCP3208 mcp28;
|
||||
#define MCP3208_CS_PIN 25
|
||||
|
||||
@ -28,6 +28,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
Serial.println();
|
||||
Serial.println("ADC\tCHAN\tMAXVALUE");
|
||||
Serial.print("mcp28\t");
|
||||
|
@ -2,7 +2,7 @@
|
||||
// FILE: MCP_ADC_performance.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: simple performance measurement.
|
||||
// DATE: 2020-08-14
|
||||
// URL: https://github.com/RobTillaart/MCP_ADC
|
||||
//
|
||||
// Note the deltaRead() does 1 or 2 differential reads depending
|
||||
// on positive of negative delta between 2 pins.
|
||||
@ -29,6 +29,8 @@ void setup()
|
||||
Serial.print("MCP_ADC_LIB_VERSION: ");
|
||||
Serial.println(MCP_ADC_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mcp2.begin(8);
|
||||
mcp4.begin(9);
|
||||
mcp8.begin(10);
|
||||
|
@ -16,7 +16,7 @@ begin KEYWORD2
|
||||
channels KEYWORD2
|
||||
maxValue KEYWORD2
|
||||
|
||||
analogRead KEYWORD2
|
||||
read KEYWORD2
|
||||
analogReadMultiple KEYWORD2
|
||||
differentialRead KEYWORD2
|
||||
deltaRead KEYWORD2
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/MCP_ADC.git"
|
||||
},
|
||||
"version": "0.4.0",
|
||||
"version": "0.5.0",
|
||||
"license": "MIT",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=MCP_ADC
|
||||
version=0.4.0
|
||||
version=0.5.0
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for MCP_ADC, e.g. MCP3008 SPI 10 bit, 8 channel ADC
|
||||
|
Loading…
x
Reference in New Issue
Block a user