Implementation of the fuzzy control algorithm for obstacle avoidance. This algorithm is for a two-wheel differential drive robot. It uses distance information from 3 analogue IR range sensors and controls DC motors using ESCON servo controllers. This C++ library is written for mbed LPC1768. For any questions and/or reporting bugs contact author: vans.edw@gmail.com
wheel.h
00001 #ifndef WHEEL_H 00002 #define WHEEL_H 00003 00004 #include "mbed.h" 00005 00006 class Wheel 00007 { 00008 public: 00009 00010 00011 Wheel(PinName pwm, PinName enable, PinName direction, PinName stop); 00012 void Enable(); 00013 void Disable(); 00014 void Stop(); 00015 void setForwardDirection(int dir); 00016 void Speed(float speed); 00017 void Start(); 00018 void Reverse(); 00019 00020 private: 00021 00022 PwmOut m_pwm; 00023 DigitalOut m_enable; 00024 DigitalOut m_direction; 00025 DigitalOut m_stop; 00026 00027 static const float period; 00028 00029 int forwardDir; 00030 int reverseDir; 00031 }; 00032 00033 #endif // WHEEL_H
Generated on Fri Jul 22 2022 11:40:57 by
1.7.2