Dependencies:   mbed

uitvoer/roer.cpp

Committer:
pd0wm
Date:
2011-09-27
Revision:
0:bec310bde899

File content as of revision 0:bec310bde899:

#include "roer.h"

Roer::Roer():led(LED2),rudder(p21) {
    stand = 50;
    this->write();
}

void Roer::set(int a) {
    stand = a;
    if (stand > 76)
        stand = 76;
    if (stand < 5)
        stand = 5;
    
    
    this->write();
}

int Roer::get(void) {
    return stand;
}

void Roer::write(void){
    led = stand / 100.0;
    rudder.pulsewidth(0.001 +  stand / 100000.0);
}