b15f/control/examples/pwm/main.cpp

17 lines
320 B
C++
Raw Normal View History

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