ライントレーサPD制御 ロボット製作セミナー演習ex

Dependencies:   mbed

Committer:
jksoft
Date:
Sat Aug 10 04:13:15 2013 +0000
Revision:
0:b5d91230ff3c
Rev1

Who changed what in which revision?

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