TB6612FNG用のモータコントロールライブラリ
Dependents: TB6612FNG_test line_trace_sample line_trace_sample_saitou line_trace_sample_tamada ... more
TB6612.h@0:810f315ba3dc, 2012-10-23 (annotated)
- Committer:
- jksoft
- Date:
- Tue Oct 23 15:24:30 2012 +0000
- Revision:
- 0:810f315ba3dc
- Child:
- 1:051a7ecff13e
- Child:
- 2:ad4e7374e5c1
TB6612FNG???????????????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:810f315ba3dc | 1 | /** |
jksoft | 0:810f315ba3dc | 2 | * Motor Driver TB6612 Control Library |
jksoft | 0:810f315ba3dc | 3 | * |
jksoft | 0:810f315ba3dc | 4 | * -- TB6612 is a device of the rohm. |
jksoft | 0:810f315ba3dc | 5 | * |
jksoft | 0:810f315ba3dc | 6 | * Copyright (C) 2012 Junichi Katsu (JKSOFT) |
jksoft | 0:810f315ba3dc | 7 | */ |
jksoft | 0:810f315ba3dc | 8 | |
jksoft | 0:810f315ba3dc | 9 | #ifndef MBED_TB6612_H |
jksoft | 0:810f315ba3dc | 10 | #define MBED_TB6612_H |
jksoft | 0:810f315ba3dc | 11 | |
jksoft | 0:810f315ba3dc | 12 | #include "mbed.h" |
jksoft | 0:810f315ba3dc | 13 | |
jksoft | 0:810f315ba3dc | 14 | class TB6612 { |
jksoft | 0:810f315ba3dc | 15 | public: |
jksoft | 0:810f315ba3dc | 16 | TB6612(PinName pwm, PinName fwd, PinName rev); |
jksoft | 0:810f315ba3dc | 17 | void speed(float speed); |
jksoft | 0:810f315ba3dc | 18 | void move(float speed , float time); |
jksoft | 0:810f315ba3dc | 19 | void operator= ( float value ) |
jksoft | 0:810f315ba3dc | 20 | { |
jksoft | 0:810f315ba3dc | 21 | speed(value); |
jksoft | 0:810f315ba3dc | 22 | } |
jksoft | 0:810f315ba3dc | 23 | |
jksoft | 0:810f315ba3dc | 24 | protected: |
jksoft | 0:810f315ba3dc | 25 | PwmOut _pwm; |
jksoft | 0:810f315ba3dc | 26 | DigitalOut _fwd; |
jksoft | 0:810f315ba3dc | 27 | DigitalOut _rev; |
jksoft | 0:810f315ba3dc | 28 | Timeout timer; |
jksoft | 0:810f315ba3dc | 29 | float bspeed; |
jksoft | 0:810f315ba3dc | 30 | bool timer_flag; |
jksoft | 0:810f315ba3dc | 31 | void timeout(); |
jksoft | 0:810f315ba3dc | 32 | |
jksoft | 0:810f315ba3dc | 33 | }; |
jksoft | 0:810f315ba3dc | 34 | |
jksoft | 0:810f315ba3dc | 35 | #endif |