b15f/control/examples/pwm/main.cpp

16 lines
291 B
C++
Raw Normal View History

2019-05-28 12:32:31 +02:00
#include <iostream>
#include <cmath>
#include <b15f/b15f.h>
2019-06-07 10:47:34 +02:00
/*
* Erzeugt ein PWM Signal an PB4 mit 100KHz.
* Beste Frequenz: 31300
*/
2019-05-28 12:32:31 +02:00
int main()
{
B15F& drv = B15F::getInstance();
2019-06-07 10:47:34 +02:00
std::cout << "TOP: " << (int) drv.pwmSetFrequency(31300) << std::endl;
drv.pwmSetValue(127);
2019-05-28 12:32:31 +02:00
}