17 namespace duds {
namespace hardware {
namespace devices {
namespace instruments {
20 com(
std::
move(c)), mode(Sleep), fps1Not10(0), misid(0) {
26 std::this_thread::sleep_for(std::chrono::milliseconds(50));
41 std::this_thread::sleep_for(std::chrono::milliseconds(50));
46 std::this_thread::sleep_for(std::chrono::milliseconds(50));
83 std::this_thread::sleep_for(std::chrono::milliseconds(50));
114 std::this_thread::sleep_for(std::chrono::milliseconds(50));
122 temp = duds::general::SignedMagnitudeToTwosComplement<12>(t);
123 double *pixel = &(
img[0][0]);
124 for (
int c = 64; c > 0; --c, ++pixel) {
127 val = duds::general::SignExtend<12>(val);
128 *pixel = (double)val / 4.0 + 273.15;
134 (
double)
temp / 16.0 + 273.15,
A container for a value and a unit to better describe the value.
void clear()
Makes the conversation empty.
ConversationPart & breakBefore()
Flags the conversation part to have a break before this part is sent.
void configure(bool fps1)
Configures the device.
ConversationVector & addInputVector(std::size_t len)
Creates a new ConversationVector for fixed length input and initializes it with the given length...
~AMG88xx()
Suspends the device operation (sleep mode) if a DeviceMisidentified error did not occur on the last s...
duds::data::Quantity temperature() const
Returns the temperature of the device as reported by its thermistor.
void suspend()
Transitions the device to sleep mode.
move_impl move(unsigned int c, unsigned int r)
Display stream manipulator that moves the display cursor to the given location.
unsigned int mode
Current operating mode.
void sample()
Reads a sample from the device.
void start()
Transitions the device to normal operating mode so that it begins sampling.
unsigned int fps1Not10
Frame rate setting.
unsigned int misid
True when the last read of the operating mode failed on error, or provided a result that did not matc...
Regular sampling at 1Hz or 10Hz.
std::unique_ptr< duds::hardware::interface::I2c > com
The I2C communication interface.
AMG88xx(std::unique_ptr< duds::hardware::interface::I2c > &c)
Attempts to reset the device and put it into sleep mode.
An attempt was made to use a device that seems to exist, but the responding device is not the type th...
std::int16_t temp
Thermistor temperature.
No sampling ; reduced power usage.
ConversationVector & addOutputVector()
Creates a new ConversationVector for output and returns it for modification.
duds::hardware::interface::Conversation read
Used to read in sampled data from the device.
#define DUDS_THROW_EXCEPTION(x)
Works like BOOST_THROW_EXCEPTION, but includes a stack trace if DUDS_ERRORS_VERBOSE is defined...
double img[8][8]
Temperature image.
Represents a two-way conversation with a device.
constexpr Unit Kelvin(DUDS_UNIT_VALUE(0, 0, 1, 0, 0, 0, 0, 0, 0))