Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed FootileSoftware
Footile.h@1:7fb4f7e80d92, 2020-03-08 (annotated)
- Committer:
- yuyaro
- Date:
- Sun Mar 08 06:27:52 2020 +0000
- Revision:
- 1:7fb4f7e80d92
- Parent:
- 0:03cdee95fb5a
Walking experiment software
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Uchida0923 | 0:03cdee95fb5a | 1 | /* |
| Uchida0923 | 0:03cdee95fb5a | 2 | Taku Hachisu 06/01/2017 |
| Uchida0923 | 0:03cdee95fb5a | 3 | |
| Uchida0923 | 0:03cdee95fb5a | 4 | Footile demo for WHC2017 |
| Uchida0923 | 0:03cdee95fb5a | 5 | */ |
| Uchida0923 | 0:03cdee95fb5a | 6 | |
| Uchida0923 | 0:03cdee95fb5a | 7 | #ifndef FOOTILE_H |
| Uchida0923 | 0:03cdee95fb5a | 8 | #define FOOTILE_H |
| Uchida0923 | 0:03cdee95fb5a | 9 | |
| Uchida0923 | 0:03cdee95fb5a | 10 | #include "mbed.h" |
| Uchida0923 | 0:03cdee95fb5a | 11 | #include "DRV2605.h" |
| Uchida0923 | 0:03cdee95fb5a | 12 | |
| Uchida0923 | 0:03cdee95fb5a | 13 | #include "wave.h" |
| Uchida0923 | 0:03cdee95fb5a | 14 | |
| Uchida0923 | 0:03cdee95fb5a | 15 | |
| Uchida0923 | 0:03cdee95fb5a | 16 | |
| Uchida0923 | 0:03cdee95fb5a | 17 | class Footile |
| Uchida0923 | 0:03cdee95fb5a | 18 | { |
| Uchida0923 | 0:03cdee95fb5a | 19 | |
| Uchida0923 | 0:03cdee95fb5a | 20 | public: |
| Uchida0923 | 0:03cdee95fb5a | 21 | /** |
| Uchida0923 | 0:03cdee95fb5a | 22 | Constructor for Footile Objects |
| Uchida0923 | 0:03cdee95fb5a | 23 | */ |
| Uchida0923 | 0:03cdee95fb5a | 24 | Footile(PinName led1, PinName led2, PinName led3, PinName trg, PinName ad, PinName tx, PinName rx, PinName io1, PinName io2, PinName sda, PinName scl, PinName en); |
| Uchida0923 | 0:03cdee95fb5a | 25 | |
| Uchida0923 | 0:03cdee95fb5a | 26 | /** |
| Uchida0923 | 0:03cdee95fb5a | 27 | functions |
| Uchida0923 | 0:03cdee95fb5a | 28 | */ |
| Uchida0923 | 0:03cdee95fb5a | 29 | void doFunctions(void); |
| Uchida0923 | 0:03cdee95fb5a | 30 | |
| Uchida0923 | 0:03cdee95fb5a | 31 | private: |
| Uchida0923 | 0:03cdee95fb5a | 32 | DRV2605 _Vibration; |
| Uchida0923 | 0:03cdee95fb5a | 33 | DigitalOut _led1; // for debugging |
| Uchida0923 | 0:03cdee95fb5a | 34 | DigitalOut _led2; // for debugging |
| Uchida0923 | 0:03cdee95fb5a | 35 | DigitalOut _led3; // for debugging |
| Uchida0923 | 0:03cdee95fb5a | 36 | DigitalOut _trg; |
| yuyaro | 1:7fb4f7e80d92 | 37 | //PwmOut _trg; |
| Uchida0923 | 0:03cdee95fb5a | 38 | AnalogIn _prssr; |
| Uchida0923 | 0:03cdee95fb5a | 39 | Serial _bt; |
| Uchida0923 | 0:03cdee95fb5a | 40 | DigitalOut _btDummy1; // LPC11U24 does not support flow control |
| Uchida0923 | 0:03cdee95fb5a | 41 | DigitalOut _btDummy2; // LPC11U24 does not support flow control |
| Uchida0923 | 0:03cdee95fb5a | 42 | Ticker _heart; |
| Uchida0923 | 0:03cdee95fb5a | 43 | Ticker _trans; |
| Uchida0923 | 0:03cdee95fb5a | 44 | |
| Uchida0923 | 0:03cdee95fb5a | 45 | Ticker _viber; |
| yuyaro | 1:7fb4f7e80d92 | 46 | Ticker _pwmviber; |
| Uchida0923 | 0:03cdee95fb5a | 47 | |
| Uchida0923 | 0:03cdee95fb5a | 48 | int _volumeBuf; |
| yuyaro | 1:7fb4f7e80d92 | 49 | int _SquareVolume; |
| yuyaro | 1:7fb4f7e80d92 | 50 | int _C_Volume; |
| Uchida0923 | 0:03cdee95fb5a | 51 | float _sens; |
| Uchida0923 | 0:03cdee95fb5a | 52 | char _buf[5]; |
| Uchida0923 | 0:03cdee95fb5a | 53 | int _countSize; |
| Uchida0923 | 0:03cdee95fb5a | 54 | int _on; |
| Uchida0923 | 0:03cdee95fb5a | 55 | |
| yuyaro | 1:7fb4f7e80d92 | 56 | int count_u; |
| yuyaro | 1:7fb4f7e80d92 | 57 | int count_pwm; |
| yuyaro | 1:7fb4f7e80d92 | 58 | int _trg_flag; |
| yuyaro | 1:7fb4f7e80d92 | 59 | int count_led2; |
| Uchida0923 | 0:03cdee95fb5a | 60 | |
| Uchida0923 | 0:03cdee95fb5a | 61 | bool ChangeFlag; |
| yuyaro | 1:7fb4f7e80d92 | 62 | bool ChangeFlag2; |
| yuyaro | 1:7fb4f7e80d92 | 63 | bool SteadyON; |
| yuyaro | 1:7fb4f7e80d92 | 64 | bool VibeON; |
| yuyaro | 1:7fb4f7e80d92 | 65 | bool SetDutyMode; |
| yuyaro | 1:7fb4f7e80d92 | 66 | bool leafMode; |
| Uchida0923 | 0:03cdee95fb5a | 67 | bool SteadyMode; |
| Uchida0923 | 0:03cdee95fb5a | 68 | bool SinewaveMode; |
| Uchida0923 | 0:03cdee95fb5a | 69 | bool CorrespondMode; |
| Uchida0923 | 0:03cdee95fb5a | 70 | bool ConnectCheck; |
| Uchida0923 | 0:03cdee95fb5a | 71 | bool snowMode; |
| Uchida0923 | 0:03cdee95fb5a | 72 | bool grassMode; |
| yuyaro | 1:7fb4f7e80d92 | 73 | bool gravelMode; |
| Uchida0923 | 0:03cdee95fb5a | 74 | |
| Uchida0923 | 0:03cdee95fb5a | 75 | void _onReceive(void); |
| Uchida0923 | 0:03cdee95fb5a | 76 | void _beat(void); |
| Uchida0923 | 0:03cdee95fb5a | 77 | void _transmission(void); |
| Uchida0923 | 0:03cdee95fb5a | 78 | unsigned short ctoi(char c); |
| Uchida0923 | 0:03cdee95fb5a | 79 | void _modeChange(unsigned short c); |
| Uchida0923 | 0:03cdee95fb5a | 80 | void VibeTimer(); |
| Uchida0923 | 0:03cdee95fb5a | 81 | void OnVibe(const float* wave, int size); |
| yuyaro | 1:7fb4f7e80d92 | 82 | void PwmDuty(int d); |
| yuyaro | 1:7fb4f7e80d92 | 83 | void PwmVibe(); |
| Uchida0923 | 0:03cdee95fb5a | 84 | |
| Uchida0923 | 0:03cdee95fb5a | 85 | }; |
| Uchida0923 | 0:03cdee95fb5a | 86 | |
| Uchida0923 | 0:03cdee95fb5a | 87 | #endif |