mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.4.0 DAC8551
This commit is contained in:
parent
dc3f044bf9
commit
d41690ed23
@ -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.4.0] - 2024-01-20
|
||||
- Fix #19, improve handling SPI dependency.
|
||||
- update examples
|
||||
|
||||
----
|
||||
|
||||
## [0.3.0] - 2023-12-01
|
||||
- refactor constructor interface - breaking changes.
|
||||
- minimize conditional code. -- create SPI_CLASS macro to solve it.
|
||||
|
@ -2,7 +2,7 @@
|
||||
// FILE: DAC8551.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: Arduino library for DAC8551 SPI Digital Analog Convertor
|
||||
// VERSION: 0.3.0
|
||||
// VERSION: 0.4.0
|
||||
// URL: https://github.com/RobTillaart/DAC8551
|
||||
|
||||
|
||||
@ -40,9 +40,9 @@ void DAC8551::begin()
|
||||
|
||||
if(_hwSPI)
|
||||
{
|
||||
_mySPI->end();
|
||||
_mySPI->begin();
|
||||
delay(1);
|
||||
// _mySPI->end();
|
||||
// _mySPI->begin();
|
||||
// delay(1);
|
||||
}
|
||||
else // SOFTWARE SPI
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: Arduino library for DAC8551 SPI Digital Analog Convertor
|
||||
// could work with DAC8550, not tested
|
||||
// VERSION: 0.3.0
|
||||
// VERSION: 0.4.0
|
||||
// HISTORY: See DAC8551.cpp
|
||||
// URL: https://github.com/RobTillaart/DAC8551
|
||||
//
|
||||
@ -14,7 +14,7 @@
|
||||
#include "SPI.h"
|
||||
|
||||
|
||||
#define DAC8551_LIB_VERSION (F("0.3.0"))
|
||||
#define DAC8551_LIB_VERSION (F("0.4.0"))
|
||||
|
||||
|
||||
#define DAC8551_POWERDOWN_NORMAL 0
|
||||
@ -74,7 +74,7 @@ protected:
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
//
|
||||
// DERIVED DAC8501, DAC8531, DAC8550
|
||||
// DERIVED DAC8501, DAC8531, DAC8550
|
||||
//
|
||||
|
||||
#define DAC8501_POWERDOWN_NORMAL 0
|
||||
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2023 Rob Tillaart
|
||||
Copyright (c) 2017-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
|
||||
|
@ -24,6 +24,14 @@ They all have classes derived 1 to 1 from DAC8551.
|
||||
**Warning** this library is not tested extensively.
|
||||
|
||||
|
||||
|
||||
## [0.4.0] - 2024-01-20
|
||||
- Fix #19, improve handling SPI dependency.
|
||||
- update examples
|
||||
|
||||
----
|
||||
|
||||
|
||||
#### 0.3.0 Breaking change
|
||||
|
||||
The version 0.3.0 has breaking changes in the interface.
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include "DAC8551.h"
|
||||
|
||||
|
||||
// select, data, clock
|
||||
DAC8531 mydac(8, 11, 13);
|
||||
|
||||
@ -18,6 +19,8 @@ void setup()
|
||||
Serial.print("DAC8551_LIB_VERSION: ");
|
||||
Serial.println(DAC8551_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mydac.begin();
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,8 @@ void setup()
|
||||
Serial.print("DAC8551_LIB_VERSION: ");
|
||||
Serial.println(DAC8551_LIB_VERSION);
|
||||
|
||||
mySPI->begin();
|
||||
|
||||
mydac.begin();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "DAC8551.h"
|
||||
|
||||
|
||||
// select, address HW SPI
|
||||
DAC8551 mydac(10, &SPI); // explicit SPI
|
||||
|
||||
@ -20,6 +21,8 @@ void setup()
|
||||
Serial.print("DAC8551_LIB_VERSION: ");
|
||||
Serial.println(DAC8551_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mydac.begin();
|
||||
}
|
||||
|
||||
@ -55,5 +58,5 @@ void loop()
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -2,9 +2,7 @@
|
||||
// FILE: DAC8551_powerdown.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo DAC8551 library Arduino
|
||||
// VERSION: 0.2.0
|
||||
// URL: https://github.com/RobTillaart/DAC8551
|
||||
//
|
||||
|
||||
|
||||
#include "DAC8551.h"
|
||||
@ -21,6 +19,8 @@ void setup()
|
||||
Serial.print("DAC8551_LIB_VERSION: ");
|
||||
Serial.println(DAC8551_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mydac.begin();
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,7 @@
|
||||
// FILE: DAC8551_sw_spi.ino
|
||||
// AUTHOR: Rob Tillaart
|
||||
// PURPOSE: demo DAC8551 library Arduino with software SPI
|
||||
// VERSION: 0.2.0
|
||||
// URL: https://github.com/RobTillaart/DAC8551
|
||||
//
|
||||
|
||||
|
||||
#include "DAC8551.h"
|
||||
@ -21,13 +19,15 @@ void setup()
|
||||
Serial.print("DAC8551_LIB_VERSION: ");
|
||||
Serial.println(DAC8551_LIB_VERSION);
|
||||
|
||||
SPI.begin();
|
||||
|
||||
mydac.begin();
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
// minimal sawtooth
|
||||
// minimal sawtooth
|
||||
for (uint16_t val = 0; val < 65500; val+= 30)
|
||||
{
|
||||
mydac.setValue(val);
|
||||
@ -40,7 +40,7 @@ void loop()
|
||||
}
|
||||
Serial.println();
|
||||
|
||||
// minimal sinus
|
||||
// minimal sinus
|
||||
for (long i = 0; i < 360; i++ )
|
||||
{
|
||||
long s = 32768 + 32768 * sin( i * (PI / 180.0));
|
||||
@ -56,5 +56,5 @@ void loop()
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/DAC8551"
|
||||
},
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.0",
|
||||
"license": "MIT",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=DAC8551
|
||||
version=0.3.0
|
||||
version=0.4.0
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for DAC8501, DAC8531, DAC8550 and DAC8551 SPI 16-bit Digital Analog Convertor.
|
||||
|
Loading…
x
Reference in New Issue
Block a user