2018 HongoMechaTech A

Dependencies:   mbed

Committer:
Komazawa_sun
Date:
Tue Sep 18 03:11:01 2018 +0000
Revision:
0:e83b840a5f86
????????????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Komazawa_sun 0:e83b840a5f86 1 #ifndef LINER_FUNCTION_H_
Komazawa_sun 0:e83b840a5f86 2 #define LINER_FUNCTION_H_
Komazawa_sun 0:e83b840a5f86 3
Komazawa_sun 0:e83b840a5f86 4 #include "mbed.h"
Komazawa_sun 0:e83b840a5f86 5
Komazawa_sun 0:e83b840a5f86 6 #define LF_MAX_TIME 1000
Komazawa_sun 0:e83b840a5f86 7
Komazawa_sun 0:e83b840a5f86 8 class LinearFunction
Komazawa_sun 0:e83b840a5f86 9 {
Komazawa_sun 0:e83b840a5f86 10 public:
Komazawa_sun 0:e83b840a5f86 11 LinearFunction(unsigned int op_period_ms);
Komazawa_sun 0:e83b840a5f86 12 void set(const double val, const double intercept, const unsigned int ct_ms);
Komazawa_sun 0:e83b840a5f86 13 void reset();
Komazawa_sun 0:e83b840a5f86 14 double get_val();
Komazawa_sun 0:e83b840a5f86 15 private:
Komazawa_sun 0:e83b840a5f86 16 double _op_period;
Komazawa_sun 0:e83b840a5f86 17 //double _val;
Komazawa_sun 0:e83b840a5f86 18 double _range;
Komazawa_sun 0:e83b840a5f86 19 double _intercept;
Komazawa_sun 0:e83b840a5f86 20 double _ct_s;
Komazawa_sun 0:e83b840a5f86 21 double _current_val;
Komazawa_sun 0:e83b840a5f86 22
Komazawa_sun 0:e83b840a5f86 23 Ticker _ticker;
Komazawa_sun 0:e83b840a5f86 24 Timer _timer;
Komazawa_sun 0:e83b840a5f86 25
Komazawa_sun 0:e83b840a5f86 26 void _on_operate();
Komazawa_sun 0:e83b840a5f86 27 };
Komazawa_sun 0:e83b840a5f86 28
Komazawa_sun 0:e83b840a5f86 29 #endif