Loom 4 v4.5
Arduino library for Internet of Things Rapid Prototyping in environmental sensing
Loading...
Searching...
No Matches
Loom_ADS1232.h
1#pragma once
2
3#include "Module.h"
4#include "Loom_Manager.h"
5
6#include <ADS1232_Lib.h>
7
8
14class Loom_ADS1232 : public Module{
15 protected:
16
17
18 public:
19 Loom_ADS1232(Manager& man, int num_samples = 1, long offset = 8403613, float scale = 2041.46);
20
21 void initialize() override;
22 void power_up() override;
23 void power_down() override;
24 void measure() override;
25 void package() override;
26
30 void calibrate();
31
35 float getWeight() { return weight; };
36 float getRaw() {return inst.raw_read(8); };
37
38 private:
39 Manager* manInst; // Instance of the Manager
40
41 ADS1232_Lib inst; // Instance of the library
42
43 float weight; // Weight output
44
45 long offset; // Calibration offset
46 float scale; // Calibration scale
47 int num_samples; // Number of samples to collect
48
49};
Definition: Loom_ADS1232.h:14
float getWeight()
Definition: Loom_ADS1232.h:35
void calibrate()
Definition: Loom_ADS1232.cpp:52
Definition: Loom_Manager.h:18
Definition: Module.h:30