1 #ifndef _SEESAW_SPECTRUM_H 2 #define _SEESAW_SPECTRUM_H 36 memset(bins, 0,
sizeof bins);
56 uint8_t
getLevel(uint8_t idx)
const {
return bins[idx < 64 ? idx : 63]; }
64 uint8_t *
getBuffer(
void)
const {
return (uint8_t *)bins; }
70 #endif // end _SEESAW_SPECTRUM_H uint8_t getLevel(uint8_t idx) const
Get value of individual spectrum bin, as determined during most recent get_data() call...
Definition: seesaw_spectrum.h:56
bool begin(uint8_t addr=SEESAW_ADDRESS, int8_t flow=-1)
Begin communication with Seesaw audio spectrum device.
Definition: seesaw_spectrum.h:34
uint8_t getChannel(void)
Query the current analog input channel.
Definition: seesaw_spectrum.cpp:51
Class that stores state and functions for interacting with seesaw helper IC.
Definition: Adafruit_seesaw.h:235
uint8_t getRate(void)
Query the current audio sampling rate.
Definition: seesaw_spectrum.cpp:41
bool begin(uint8_t addr=SEESAW_ADDRESS, int8_t flow=-1, bool reset=true)
Start the seesaw.
Definition: Adafruit_seesaw.cpp:62
#define SEESAW_ADDRESS
Default Seesaw I2C address.
Definition: Adafruit_seesaw.h:31
void setChannel(uint8_t value)
Set the analog input channel.
Definition: seesaw_spectrum.cpp:31
seesaw_Audio_Spectrum(TwoWire *Wi=NULL)
seesaw_Audio_Spectrum class constructor.
Definition: seesaw_spectrum.h:21
void setRate(uint8_t value)
Set the audio sampling rate.
Definition: seesaw_spectrum.cpp:20
Class that stores state and functions for seesaw audio spectrum interface.
Definition: seesaw_spectrum.h:13
uint8_t * getBuffer(void) const
Get pointer to spectrum bin buffer directly. Use with caution!
Definition: seesaw_spectrum.h:64
void getData(void)
Pull latest audio spectrum data from device.
Definition: seesaw_spectrum.cpp:8