gestion d'un moteur avec une classe

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MOTOR.h Source File

MOTOR.h

00001 #ifndef MOTOR_H
00002 #define MOTOR_H
00003 
00004 #include "mbed.h"
00005 
00006 class MOTOR
00007 {
00008 
00009 public:
00010 
00011 
00012 
00013 MOTOR(PinName pwm, PinName sens);
00014 
00015 void init();
00016 void period(float);
00017 void speed(int);
00018 
00019 int readspeed();
00020 
00021 private :
00022 float periode;
00023 int vitesse;
00024 int sens;
00025     DigitalOut _sens;
00026     PwmOut _pwm;
00027    
00028 };
00029 
00030 #endif