Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit d719f9f

Browse files
authored
v1.2.1 to fix DutyCycle bug, etc.
### Releases v1.2.1 1. Fix `DutyCycle` bug. Check [float precisison of DutyCycle only sometimes working #3](khoih-prog/SAMD_Slow_PWM#3) 2. Fix `New Period` display bug. Check [random dropouts #4](khoih-prog/SAMD_Slow_PWM#4) 3. Update examples
1 parent f1e5ce1 commit d719f9f

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

examples/ISR_8_PWMs_Array/ISR_8_PWMs_Array.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#error This is designed only for Arduino or MegaCoreX megaAVR board! Please check your Tools->Board setting
2121
#endif
2222

23-
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
23+
// These define's must be placed at the beginning before #include "megaAVR_Slow_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
2626
#define _PWM_LOGLEVEL_ 3

examples/ISR_8_PWMs_Array_Complex/ISR_8_PWMs_Array_Complex.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#error This is designed only for Arduino or MegaCoreX megaAVR board! Please check your Tools->Board setting
2121
#endif
2222

23-
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
23+
// These define's must be placed at the beginning before #include "megaAVR_Slow_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
2626
#define _PWM_LOGLEVEL_ 3

examples/ISR_8_PWMs_Array_Simple/ISR_8_PWMs_Array_Simple.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#error This is designed only for Arduino or MegaCoreX megaAVR board! Please check your Tools->Board setting
2121
#endif
2222

23-
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
23+
// These define's must be placed at the beginning before #include "megaAVR_Slow_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
2626
#define _PWM_LOGLEVEL_ 3

examples/ISR_Changing_PWM/ISR_Changing_PWM.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#error This is designed only for Arduino or MegaCoreX megaAVR board! Please check your Tools->Board setting
2121
#endif
2222

23-
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
23+
// These define's must be placed at the beginning before #include "megaAVR_Slow_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
2626
#define _PWM_LOGLEVEL_ 3

examples/ISR_Modify_PWM/ISR_Modify_PWM.ino

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#error This is designed only for Arduino or MegaCoreX megaAVR board! Please check your Tools->Board setting
2121
#endif
2222

23-
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
23+
// These define's must be placed at the beginning before #include "megaAVR_Slow_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
2626
#define _PWM_LOGLEVEL_ 3
@@ -86,19 +86,19 @@ void TimerHandler()
8686
uint32_t PWM_Pin = LED_BUILTIN;
8787

8888
// You can assign any interval for any timer here, in Hz
89-
float PWM_Freq1 = 1.0f;
89+
float PWM_Freq1 = 200.0f; //1.0f;
9090
// You can assign any interval for any timer here, in Hz
91-
float PWM_Freq2 = 2.0f;
91+
float PWM_Freq2 = 100.0f; //2.0f;
9292

9393
// You can assign any interval for any timer here, in microseconds
9494
uint32_t PWM_Period1 = 1000000 / PWM_Freq1;
9595
// You can assign any interval for any timer here, in microseconds
9696
uint32_t PWM_Period2 = 1000000 / PWM_Freq2;
9797

9898
// You can assign any duty_cycle for any PWM here, from 0-100
99-
float PWM_DutyCycle1 = 50.0;
99+
float PWM_DutyCycle1 = 1.0f; //50.0f;
100100
// You can assign any duty_cycle for any PWM here, from 0-100
101-
float PWM_DutyCycle2 = 90.0;
101+
float PWM_DutyCycle2 = 5.55f; //90.0f;
102102

103103
// Channel number used to identify associated channel
104104
int channelNum;
@@ -219,8 +219,8 @@ void changePWM()
219219
{
220220
static uint8_t count = 1;
221221

222-
double PWM_Freq;
223-
uint32_t PWM_DutyCycle;
222+
float PWM_Freq;
223+
float PWM_DutyCycle;
224224

225225
if (count++ % 2)
226226
{

examples/multiFileProject/multiFileProject.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#error This is designed only for Arduino or MegaCoreX megaAVR board! Please check your Tools->Board setting
1818
#endif
1919

20-
#define MEGA_AVR_SLOW_PWM_VERSION_MIN_TARGET F("megaAVR_SLOW_PWM v1.2.0")
21-
#define MEGA_AVR_SLOW_PWM_VERSION_MIN 1002000
20+
#define MEGA_AVR_SLOW_PWM_VERSION_MIN_TARGET F("megaAVR_SLOW_PWM v1.2.1")
21+
#define MEGA_AVR_SLOW_PWM_VERSION_MIN 1002001
2222

2323
#include "multiFileProject.h"
2424

0 commit comments

Comments
 (0)