Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of DrehungMitStopp by
Servo.cpp
00001 #include "Servo.h" 00002 #include "mbed.h" 00003 00004 Servo::Servo(PinName Pin) : ServoPin(Pin) {} 00005 00006 void Servo::SetPosition(int Pos) { 00007 Position = Pos; 00008 } 00009 00010 void Servo::StartPulse() { 00011 ServoPin = 1; 00012 PulseStop.attach_us(this, &Servo::EndPulse, Position); 00013 } 00014 00015 void Servo::EndPulse() { 00016 ServoPin = 0; 00017 } 00018 00019 void Servo::Enable(int StartPos, int Period) { 00020 Position = StartPos; 00021 Pulse.attach_us(this, &Servo::StartPulse, Period); 00022 } 00023 00024 void Servo::Disable() { 00025 Pulse.detach(); 00026 }
Generated on Sat Jul 30 2022 21:47:01 by
1.7.2
