b15f/control/examples/servo/main.cpp

24 lines
375 B
C++
Raw Normal View History

2019-06-27 15:29:18 +02:00
#include <b15f/b15f.h>
/*
2019-06-27 16:19:27 +02:00
* Dieses Beispiel steuert einen Servo an PB2 an.
2019-06-27 15:29:18 +02:00
*
*/
int main()
{
B15F& drv = B15F::getInstance();
// aktiviere Servo Signal
drv.setServoEnabled();
2019-06-27 16:23:37 +02:00
drv.delay_ms(3000);
2019-06-27 15:29:18 +02:00
// drehe Servo
drv.setServoPosition(1000);
2019-06-27 16:23:37 +02:00
drv.delay_ms(3000);
2019-06-27 15:29:18 +02:00
2019-06-27 16:23:37 +02:00
// deaktiviere Servo Signal
drv.setServoDisabled();
2019-06-27 15:29:18 +02:00
}