![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Diff: uitvoer/roer.cpp
- Revision:
- 0:bec310bde899
diff -r 000000000000 -r bec310bde899 uitvoer/roer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/uitvoer/roer.cpp Tue Sep 27 19:46:30 2011 +0000 @@ -0,0 +1,27 @@ +#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); +} + \ No newline at end of file