ASCEND Flight Software
Loading...
Searching...
No Matches
AS7331Sensor.h
Go to the documentation of this file.
1#ifndef AS7331SENSOR_H
2#define AS7331SENSOR_H
3
4#include <SparkFun_AS7331.h>
5#include <Wire.h>
6#include <string.h>
7
8#include "PayloadConfig.h"
9#include "Sensor.h"
10
15class AS7331Sensor : public Sensor {
16 private:
17 SfeAS7331ArdI2C myUVSensor;
18 uint8_t i2c_addr;
19
20 public:
21 AS7331Sensor(uint8_t i2c_addr);
22 AS7331Sensor(unsigned long minimum_period, uint8_t i2c_addr);
23
24 bool verify() override;
25 void readDataPacket(uint8_t*& packet) override;
26 String decodeToCSV(uint8_t*& packet) override;
27 String readData() override;
28};
29
30#endif
Central location for pinout and config defines.
Implementation of a Sensor for UVA/B/C sensor.
Definition AS7331Sensor.h:15
String readData() override
Reads UV data.
Definition AS7331Sensor.cpp:41
SfeAS7331ArdI2C myUVSensor
Definition AS7331Sensor.h:17
bool verify() override
Returns if the sensor can be reached.
Definition AS7331Sensor.cpp:31
void readDataPacket(uint8_t *&packet) override
Reads UV data from the sensor and writes it to the packet.
Definition AS7331Sensor.cpp:56
uint8_t i2c_addr
Definition AS7331Sensor.h:18
String decodeToCSV(uint8_t *&packet) override
Decodes a packet into a CSV string.
Definition AS7331Sensor.cpp:77
Parent class for sensor objects.
Definition Sensor.h:13
unsigned long minimum_period
Definition Sensor.h:15