SP1 vers 3

Dependents:   SoufflerieSP1-vers2

pwm.cpp

Committer:
petit
Date:
2021-06-08
Revision:
0:63a2685bf4f0

File content as of revision 0:63a2685bf4f0:

#include "mbed.h"
#include "pwm.h"
PwmOut PwmMot(PA_15);

void InitPwmMot(void)
{ 
  PwmMot.period_ms(20);
  PwmMot.pulsewidth_us(875);
}

void SetPwmMot(unsigned char Pourcent)
{ 
  int th = 875 + (float)Pourcent * 11.25;
  PwmMot.pulsewidth_us(th);
}