This is a library for the electrical control of muscles. 筋肉に電気を流して制御して遊ぶためのライブラリ

Committer:
mhdk
Date:
Sun Jan 10 21:04:04 2021 +0000
Revision:
0:f70df5665a61
init

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mhdk 0:f70df5665a61 1 /*!
mhdk 0:f70df5665a61 2 * @file MuscleWrite.h
mhdk 0:f70df5665a61 3 * @brief basic program for muscle controll with mbed/nucleo f446RE
mhdk 0:f70df5665a61 4 * @author m.hdk <m.hdk816@gmail.com>
mhdk 0:f70df5665a61 5 * @date 2021
mhdk 0:f70df5665a61 6 */
mhdk 0:f70df5665a61 7
mhdk 0:f70df5665a61 8 #ifndef MuscleWrite_H
mhdk 0:f70df5665a61 9 #define MuscleWrite_H
mhdk 0:f70df5665a61 10
mhdk 0:f70df5665a61 11 #include "mbed.h"
mhdk 0:f70df5665a61 12
mhdk 0:f70df5665a61 13 class MuscleWrite
mhdk 0:f70df5665a61 14 {
mhdk 0:f70df5665a61 15 public:
mhdk 0:f70df5665a61 16 MuscleWrite(PinName pulse_pin, float period = 0.025, float width = 0.002);
mhdk 0:f70df5665a61 17 void enable();
mhdk 0:f70df5665a61 18 void disable();
mhdk 0:f70df5665a61 19 void write(bool s);
mhdk 0:f70df5665a61 20
mhdk 0:f70df5665a61 21 private:
mhdk 0:f70df5665a61 22 Timeout tim;
mhdk 0:f70df5665a61 23 Ticker tic;
mhdk 0:f70df5665a61 24 DigitalOut pulse_pin_;
mhdk 0:f70df5665a61 25 float period_;
mhdk 0:f70df5665a61 26 float width_;
mhdk 0:f70df5665a61 27 bool out;
mhdk 0:f70df5665a61 28 int over_cut_width();
mhdk 0:f70df5665a61 29 void rise();
mhdk 0:f70df5665a61 30 void fall();
mhdk 0:f70df5665a61 31 };
mhdk 0:f70df5665a61 32
mhdk 0:f70df5665a61 33 #endif