mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.2.2 AD568X
This commit is contained in:
parent
54429109ca
commit
b9559ce788
@ -1,9 +1,10 @@
|
||||
//
|
||||
// FILE: AD568X.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.1
|
||||
// VERSION: 0.2.2
|
||||
// DATE: 2023-09-18
|
||||
// PURPOSE: Arduino library for AD568X series Digital Analog Convertor.
|
||||
// URL: https://github.com/RobTillaart/AD568X
|
||||
|
||||
|
||||
#include "AD568X.h"
|
||||
|
@ -2,21 +2,24 @@
|
||||
//
|
||||
// FILE: AD568X.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.1
|
||||
// VERSION: 0.2.2
|
||||
// DATE: 2023-09-18
|
||||
// PURPOSE: Arduino library for AD568X series Digital Analog Convertor.
|
||||
// URL: https://github.com/RobTillaart/AD568X
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "SPI.h"
|
||||
|
||||
#define AD568X_LIB_VERSION (F("0.2.1"))
|
||||
#define AD568X_LIB_VERSION (F("0.2.2"))
|
||||
|
||||
|
||||
#if defined(ARDUINO_ARCH_RP2040)
|
||||
#define __SPI_CLASS__ SPIClassRP2040
|
||||
#else
|
||||
#define __SPI_CLASS__ SPIClass
|
||||
#ifndef __SPI_CLASS__
|
||||
#if defined(ARDUINO_ARCH_RP2040)
|
||||
#define __SPI_CLASS__ SPIClassRP2040
|
||||
#else
|
||||
#define __SPI_CLASS__ SPIClass
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -6,10 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.2.2] - 2024-01-02
|
||||
- fix __SPI_CLASS__
|
||||
- fix examples
|
||||
- minor edits
|
||||
|
||||
|
||||
## [0.2.1] - 2023-12-11
|
||||
- minor edit
|
||||
|
||||
|
||||
## [0.2.0] - 2023-11-26
|
||||
- refactor constructor interface - breaking changes.
|
||||
- minimize conditional code. -- create SPI_CLASS macro to solve it.
|
||||
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023-2023 Rob Tillaart
|
||||
Copyright (c) 2023-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
|
||||
|
@ -112,8 +112,11 @@ effectively a prepare + update in one call.
|
||||
Returns false if value out of range.
|
||||
- **uint16_t getValue()** returns set OR prepared value.
|
||||
At power up the DAC's will be reset to 0 Volt.
|
||||
- **bool setPercentage(float percentage)** idem.
|
||||
- **float getPercentage()** idem.
|
||||
- **bool setPercentage(float percentage)** sets the output as a percentage 0..100.
|
||||
If percentage is out of range, it is not set and the function returns false.
|
||||
- **float getPercentage()** returns percentage, wrapper around **getValue()**.
|
||||
Might return a slightly different value than **setPercentage()** due to
|
||||
rounding errors.
|
||||
- **bool prepareValue(uint16_t value)** prepares the value.
|
||||
Returns false if value out of range.
|
||||
- **bool updateValue()** writes the prepared value to ADC.
|
||||
|
@ -1,7 +1,8 @@
|
||||
//
|
||||
// FILE: AD568X_demo.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PUPROSE: test basic behaviour and performance
|
||||
// PURPOSE: test basic behaviour and performance
|
||||
// URL: https://github.com/RobTillaart/AD568X
|
||||
|
||||
|
||||
#include "AD568X.h"
|
||||
|
@ -1,7 +1,8 @@
|
||||
//
|
||||
// FILE: AD568X_demo_ESP32.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PUPROSE: test basic behaviour and performance
|
||||
// PURPOSE: test basic behaviour and performance
|
||||
// URL: https://github.com/RobTillaart/AD568X
|
||||
|
||||
|
||||
#include "AD568X.h"
|
||||
@ -42,7 +43,7 @@ void loop()
|
||||
uint32_t start = micros();
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
// AD16_HW.setValue(i);
|
||||
// AD16_HW.setValue(i);
|
||||
AD16_SW.setValue(i);
|
||||
}
|
||||
uint32_t duration = micros() - start;
|
||||
|
@ -1,7 +1,8 @@
|
||||
//
|
||||
// FILE: AD568X_demo.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PUPROSE: test basic behaviour and performance
|
||||
// PURPOSE: test basic behaviour and performance
|
||||
// URL: https://github.com/RobTillaart/AD568X
|
||||
|
||||
|
||||
#include "AD568X.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/AD568X.git"
|
||||
},
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"license": "MIT",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=AD568X
|
||||
version=0.2.1
|
||||
version=0.2.2
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for AD568X series Digital Analog Convertor.
|
||||
|
Loading…
Reference in New Issue
Block a user