SP1 vers 3

Dependents:   SoufflerieSP1-vers2

Files at this revision

API Documentation at this revision

Comitter:
petit
Date:
Tue Jun 08 10:37:05 2021 +0000
Commit message:
SP1-3

Changed in this revision

pwm.cpp Show annotated file Show diff for this revision Revisions of this file
pwm.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pwm.cpp	Tue Jun 08 10:37:05 2021 +0000
@@ -0,0 +1,15 @@
+#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);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pwm.h	Tue Jun 08 10:37:05 2021 +0000
@@ -0,0 +1,6 @@
+#ifndef _pwm_h
+#define _pwm_h
+void InitPwmMot(void);
+void SetPwmMot(unsigned char Pourcent);
+
+#endif
\ No newline at end of file