Hello Folks. I was wondering if anyone could look over why this library called QuickSPI doesn't work. It's a GitHub spi library for the INA239 power monitor sensor.
QuickSPI
I got the device reading and working with Arduino's SPI library but just couldn't keep myself away from figuring out the trouble with the QuickSPI library from github. When I compile the example code for this library it gives me errors that a .h file does not exist, so I moved that .h file into the directory one level above that. From there it just seems like more errors beyond my understanding. The below code is the example I tried.
#include <SPI.h>
#include <QuickSPI.h>
#define Pin_SPI_nCS_ADC 10
SPIClass mySPI(SPI);
INA239<> ina(mySPI, Pin_SPI_nCS_ADC, SPISettings(1000000, SPI_MSBFIRST, SPI_MODE1));
void setup() {
ina.Configure();
}
void loop() {
// Example of automatically generated register read method
// This method is automatically generated from
// QUICKSPI_DEFINE_REGISTER16_RO(ManufacturerID, (0x3E << 2) | ReadFlag) {};
uint32_t manufacturerId = zoneADC.readManufacturerID(); // Should be 0x5449
// Example
float current = zoneADC.ComputeCurrent();
float voltage = zoneADC.ComputeVoltage();
// TODO Your code goes here...
}