Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of HHH_MOTOR_TRAP_Polled_TFM by
Diff: PWM.cpp
- Revision:
- 5:f3eba32e78a7
- Parent:
- 4:2f93d15d1d3f
--- a/PWM.cpp Wed Dec 19 10:58:32 2018 +0000
+++ b/PWM.cpp Mon Mar 18 11:11:15 2019 +0000
@@ -4,10 +4,10 @@
#include "PWM.h"
#include <string>
-#define PWMPRESCALE (48-1)
+//#define PWMPRESCALE (12-1)
#define PWM 200
-void InitPWM(void)
+void InitPWM(int PWMPRESCALE)
{
LPC_PINCON->PINSEL4 = (1<<0)|(1<<0)|(1<<2)|(1<<4)|(1<<6)|(1<<8)|(1<<10); //set up the pins to be PWM outputs '01 01 01 0101 01' is pwm mode put onto Mbed pins 26,25,24,23.
LPC_PINCON->PINMODE2 |= (2<<0)|(2<<2)||(2<<4)|(2<<6)|(2<<8)|(2<<10)|(2<<12)|(2<<14)|(2<<16)|(2<<18)|(2<<20)|(2<<22)|(2<<24)|(2<<26)|(2<<28); // no pull ups //no pull ups/pull downs on PIN1
