-
Notifications
You must be signed in to change notification settings - Fork 0
/
Balance.hpp
50 lines (44 loc) · 1.5 KB
/
Balance.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* **************************************************************** */
/* ____ ______ */
/* Stepper /\###\ /#:+_+:\ */
/* \ \##+\/:+:/_\ :\ */
/* \ \#:+:+:+: : . \ */
/* By: Simon Ameye \ \:+:___: . \ */
/* \ \ :\_/. /\ \ */
/* \ \______/\ \___\ */
/* Please star my Github ! \/_____/ \/___/ */
/* https://github.com/simon-ameye/ */
/* **************************************************************** */
#ifndef BALANCE_HPP
#define BALANCE_HPP
#include "Hx711.hpp"
#include <iostream>
#include <fstream>
#include <time.h>
#include <cerrno>
#include <cstring>
#include "hardware/timer.h"
#include "hardware/flash.h"
#include "pico/stdlib.h"
#include "hardware/irq.h"
#include "hardware/sync.h"
#include "UserConfig.hpp"
class Balance
{
public:
Balance(void);
unsigned long get_sig(void);
float get_mass(void);
void set_calibration(float offcet, float sensitivity);
float get_averaged_mass(int samples);
void print_balance_data();
float get_sensivity();
float get_offset();
private:
void _save_calibration(void);
void _recover_calibraton(void);
float _offset;
float _sensivity;
Hx711 _Hx711;
};
#endif