SparkFun Spectral Sensor - AS7343  v1.0.0-4-gd418547
Library for the SparkFun SpectralSensor - AS7343
Loading...
Searching...
No Matches
SparkFun_AS7343.h
Go to the documentation of this file.
1
37 #pragma once
38
39 // clang-format off
40 #include <SparkFun_Toolkit.h>
41 #include "sfTk/sfDevAS7343.h"
42 #include <Arduino.h>
43 // clang-format on
44
69{
70 public:
72 {
73 }
74
101 bool begin(const uint8_t &address = kAS7343Addr, TwoWire &wirePort = Wire)
102 {
103 if (_theI2CBus.init(wirePort, address) != ksfTkErrOk)
104 return false;
105
106 setCommunicationBus(&_theI2CBus);
107
108 if (!isConnected())
109 return false;
110 return true;
111 }
112
133 bool isConnected(void)
134 {
135 if (_theI2CBus.ping() != ksfTkErrOk)
136 return false;
137
138 // Check the device ID
140 }
141
158 uint8_t getDeviceAddress(void)
159 {
160 return _theI2CBus.address();
161 }
162
163 private:
175 sfTkArdI2C _theI2CBus;
176};
Arduino I2C implementation for the AS7343 sensor.
Definition: SparkFun_AS7343.h:69
bool isConnected(void)
Checks if the AS7343 sensor is connected and responding.
Definition: SparkFun_AS7343.h:133
bool begin(const uint8_t &address=kAS7343Addr, TwoWire &wirePort=Wire)
Initializes the AS7343 sensor with I2C communication.
Definition: SparkFun_AS7343.h:101
SfeAS7343ArdI2C()
Definition: SparkFun_AS7343.h:71
uint8_t getDeviceAddress(void)
Gets the currently configured I2C address of the AS7343 sensor.
Definition: SparkFun_AS7343.h:158
Definition: sfDevAS7343.h:654
uint8_t getDeviceID(void)
Requests the device ID from the sensor.
Definition: sfDevAS7343.cpp:46
void setCommunicationBus(sfTkIBus *theBus)
Sets the communication bus to the specified bus.
Definition: sfDevAS7343.cpp:57
Header file for the SparkFun Spectral Sensor - AS7343.
const uint8_t kAS7343Addr
Definition: sfDevAS7343.h:51
const uint8_t kDefaultAS7343DeviceID
Definition: sfDevAS7343.h:53