四輪オムニの足回りを動かすプログラム
Embed:
(wiki syntax)
Show/hide line numbers
motor.hpp
00001 #ifndef MOTOR_ 00002 #define MOTOR_ 00003 00004 #include <mbed.h> 00005 00006 #if 0 00007 ~example~ 00008 Motor name(ピン名1,ピン名2)でこのクラスを使うことができるようになる 00009 name.revolution(pwmの値)でモータを回すことができる 00010 name.reset()でモータの値を0にする 00011 #endif 00012 00013 class Motor 00014 { 00015 public: 00016 Motor(PinName pin_a,PinName pin_b); 00017 void revolution(double); 00018 void reset(); 00019 private: 00020 PwmOut motor1; 00021 PwmOut motor2; 00022 }; 00023 00024 #endif
Generated on Sat Oct 8 2022 11:15:36 by
1.7.2