2014-git-work/arduino/catchrobo2012/Motor.h

31 lines
474 B
C
Raw Normal View History

2012-08-30 08:46:59 +09:00
/*
Motor.h
(C)2012 kou029w - MIT License [http://kou029w.appspot.com/mit-license.txt]
*/
#ifndef Motor_h
#define Motor_h
#define STOP 0
#define GO 1
#define BACK 2
#define BRAKE 3
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
class Motor{
public:
void mode(byte mode);
void mode(byte mode, byte speed);
void speed(int speed);
void attach(byte pin1, byte pin2);
private:
byte _pin1;
byte _pin2;
};
#endif