TeensyNanoExoCode
Loading...
Searching...
No Matches
ExoCode
src
TorqueSensor.h
Go to the documentation of this file.
1
12
#ifndef TorqueSensor_h
13
#define TorqueSensor_h
14
15
// Arduino compiles everything in the src folder even if not included so it causes and error for the nano if this is not included.
16
#if defined(ARDUINO_TEENSY36) || defined(ARDUINO_TEENSY41)
17
18
#include "
Board.h
"
19
#include "Arduino.h"
20
24
class
TorqueSensor
25
{
26
public
:
27
TorqueSensor(
unsigned
int
pin);
28
37
bool
calibrate(
bool
do_calibration);
38
44
float
read();
45
//MOVE BACK TO PRIVATE WHEN USING APP
46
int
_raw_reading;
48
private
:
49
int
_pin;
50
bool
_is_used;
52
float
_calibration;
53
//int _raw_reading; /**< Raw pin reading */
54
float
_calibrated_reading;
56
const
uint16_t _cal_time = 1000;
57
uint16_t _start_time;
58
bool
_last_do_calibrate;
//need to remember to reset this when cal finishes
59
float
_zero_sum;
60
uint32_t _num_calibration_samples;
62
};
63
#endif
64
#endif
Board.h
Generated by
1.9.7