abanum abanum / Motorfader

Dependents:   nekosensya

Embed: (wiki syntax)

« Back to documentation index

Motorfader Class Reference

Motorfader Class Reference

Motorfader control class, based on a PwmOut. More...

#include <Motorfader.h>

Public Member Functions

 Motorfader (PinName analogpin, PinName cwpin, PinName ccwpin)
 Create a servo object connected to the specified PwmOut pin.
void set (float pos, float vel)
 Set position.
float get ()
 Get position.

Detailed Description

Motorfader control class, based on a PwmOut.

Example:

 // Continuously sweep the servo through it's full range
 #include "mbed.h"
 #include "WT20003M03.h"
 
 WT20003M03 myaudio(p21);
 
 int main() {
       mysound.volume(8);
     while(1) {
             myaudio.play();
             wait(10);
     }
 }

Definition at line 47 of file Motorfader.h.


Constructor & Destructor Documentation

Motorfader ( PinName  analogpin,
PinName  cwpin,
PinName  ccwpin 
)

Create a servo object connected to the specified PwmOut pin.

Parameters:
pinDigitalOut pin to connect to

Definition at line 27 of file Motorfader.cpp.


Member Function Documentation

float get (  )

Get position.

Parameters:
Readvolume.

Definition at line 43 of file Motorfader.cpp.

void set ( float  pos,
float  vel 
)

Set position.

Parameters:
addres

Definition at line 37 of file Motorfader.cpp.