It is a library for controlling Wallbot mini

Dependents:   wallbotmini_test

Committer:
jksoft
Date:
Sat Nov 02 01:04:00 2013 +0000
Revision:
0:a11da93ea3f6
Rev1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:a11da93ea3f6 1 /**
jksoft 0:a11da93ea3f6 2 * Motor Driver TB6612 Control Library
jksoft 0:a11da93ea3f6 3 *
jksoft 0:a11da93ea3f6 4 * -- TB6612 is a device of the rohm.
jksoft 0:a11da93ea3f6 5 *
jksoft 0:a11da93ea3f6 6 * Copyright (C) 2012 Junichi Katsu (JKSOFT)
jksoft 0:a11da93ea3f6 7 */
jksoft 0:a11da93ea3f6 8
jksoft 0:a11da93ea3f6 9 #ifndef MBED_TB6612_H
jksoft 0:a11da93ea3f6 10 #define MBED_TB6612_H
jksoft 0:a11da93ea3f6 11
jksoft 0:a11da93ea3f6 12 #include "mbed.h"
jksoft 0:a11da93ea3f6 13
jksoft 0:a11da93ea3f6 14 class TB6612 {
jksoft 0:a11da93ea3f6 15 public:
jksoft 0:a11da93ea3f6 16 TB6612(PinName pwm, PinName fwd, PinName rev);
jksoft 0:a11da93ea3f6 17 void speed(float speed);
jksoft 0:a11da93ea3f6 18 void move(float speed , float time);
jksoft 0:a11da93ea3f6 19 void operator= ( float value )
jksoft 0:a11da93ea3f6 20 {
jksoft 0:a11da93ea3f6 21 speed(value);
jksoft 0:a11da93ea3f6 22 }
jksoft 0:a11da93ea3f6 23
jksoft 0:a11da93ea3f6 24 protected:
jksoft 0:a11da93ea3f6 25 PwmOut _pwm;
jksoft 0:a11da93ea3f6 26 DigitalOut _fwd;
jksoft 0:a11da93ea3f6 27 DigitalOut _rev;
jksoft 0:a11da93ea3f6 28 Timeout timer;
jksoft 0:a11da93ea3f6 29 float bspeed;
jksoft 0:a11da93ea3f6 30 bool timer_flag;
jksoft 0:a11da93ea3f6 31 void timeout();
jksoft 0:a11da93ea3f6 32
jksoft 0:a11da93ea3f6 33 };
jksoft 0:a11da93ea3f6 34
jksoft 0:a11da93ea3f6 35 #endif