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

Commit d835c3a

Browse files
authored
v1.1.1 to to add PWM_StepperControl example
### Releases v1.1.1 1. Add example [PWM_StepperControl](https://github.com/khoih-prog/Teensy_PWM/examples/PWM_StepperControl) to demo how to control Stepper Motor using PWM.
1 parent 81741ef commit d835c3a

File tree

7 files changed

+93
-63
lines changed

7 files changed

+93
-63
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ However, before reporting a bug please check through the following:
1010

1111
If you don't find anything, please [open a new issue](https://github.com/khoih-prog/Teensy_PWM/issues/new).
1212

13+
---
14+
1315
### How to submit a bug report
1416

1517
Please ensure to specify the following:
@@ -22,14 +24,17 @@ Please ensure to specify the following:
2224
* Operating system (Windows, Ubuntu, etc.) and the output of `uname -a`
2325
* Network configuration
2426

27+
Please be educated, civilized and constructive as you've always been. Disrespective posts against [GitHub Code of Conduct](https://docs.github.com/en/site-policy/github-terms/github-event-code-of-conduct) will be ignored and deleted.
28+
29+
---
2530

2631
### Example
2732

2833
```
2934
Arduino IDE version: 1.8.19
3035
Teensyduino Core Version 1.57
3136
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
37+
Linux xy-Inspiron-3593 5.15.0-58-generic #64~20.04.1-Ubuntu SMP Fri Jan 6 16:42:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
3338
3439
Context:
3540
I encountered a crash while using this library
@@ -68,4 +73,6 @@ xy@xy-Inspiron-3593:~/Arduino/xy/Teensy_PWM_GitHub$
6873

6974
```
7075
xy@xy-Inspiron-3593:~/Arduino/xy/Teensy_PWM_GitHub$ bash utils/restyle.sh
76+
77+
7178
```

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
1010
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
1111

12+
1213
---
1314
---
1415

@@ -39,6 +40,7 @@
3940
* [ 5. PWM_Multi](examples/PWM_Multi)
4041
* [ 6. PWM_MultiChannel](examples/PWM_MultiChannel)
4142
* [ 7. PWM_Waveform](examples/PWM_Waveform)
43+
* [ 8. PWM_StepperControl](examples/PWM_StepperControl) **New**
4244
* [Example PWM_Multi](#example-PWM_Multi)
4345
* [Debug Terminal Output Samples](#debug-terminal-output-samples)
4446
* [1. PWM_DynamicDutyCycle using FlexTimers on Teensy 4.0](#1-PWM_DynamicDutyCycle-using-FlexTimers-on-Teensy-40)
@@ -136,7 +138,7 @@ Functions using normal software-based PWMs, relying on `loop()` and calling `mil
136138
## Prerequisites
137139

138140
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
139-
2. [`Teensy Core 1.57+`](https://www.pjrc.com/teensy/td_download.html) for Teensy.
141+
2. [`Teensy core v1.57+`](https://github.com/PaulStoffregen/cores) for Teensy 4.1. [![GitHub release](https://img.shields.io/github/release/PaulStoffregen/cores.svg)](https://github.com/PaulStoffregen/cores/releases/latest)
140142

141143
---
142144
---
@@ -295,6 +297,7 @@ PWM_Instance->setPWM_manual(PWM_Pins, new_level);
295297
5. [PWM_Multi](examples/PWM_Multi)
296298
6. [PWM_MultiChannel](examples/PWM_MultiChannel)
297299
7. [PWM_Waveform](examples/PWM_Waveform)
300+
8. [PWM_StepperControl](examples/PWM_StepperControl)
298301

299302

300303
---
@@ -317,7 +320,7 @@ The following is the sample terminal output when running example [PWM_DynamicDut
317320

318321
```cpp
319322
Starting PWM_DynamicDutyCycle using FlexTimers on Teensy 4.0
320-
Teensy_PWM v1.1.0
323+
Teensy_PWM v1.1.1
321324
[PWM] setupPWM: Mapping dutycycle = 0 to newDC = 0 for _resolution = 16
322325
[PWM] setupPWM: Using FlexTimer2 moduleIndex = 1 for PWM pin = 5
323326
=====================================================================================
@@ -359,7 +362,7 @@ The following is the sample terminal output when running example [**PWM_Multi**]
359362
360363
```cpp
361364
Starting PWM_Multi using QuadTimers on Teensy 4.0
362-
Teensy_PWM v1.1.0
365+
Teensy_PWM v1.1.1
363366
[PWM] setupPWM: Mapping dutycycle = 6554 to newDC = 6554 for _resolution = 16
364367
[PWM] setupPWM: Using QuadTimer1 moduleIndex = 0 for PWM pin = 10
365368
[PWM] setPWM_Int: dutycycle = 6554 , frequency = 2000.00
@@ -405,7 +408,7 @@ The following is the sample terminal output when running example [**PWM_DynamicF
405408

406409
```cpp
407410
Starting PWM_DynamicFreq using FlexTimers on Teensy 4.0
408-
Teensy_PWM v1.1.0
411+
Teensy_PWM v1.1.1
409412
[PWM] setupPWM: Mapping dutycycle = 32768 to newDC = 32768 for _resolution = 16
410413
[PWM] setupPWM: Using FlexTimer2 moduleIndex = 1 for PWM pin = 5
411414
=====================================================================================
@@ -436,7 +439,7 @@ The following is the sample terminal output when running example [**PWM_Waveform
436439
437440
```cpp
438441
Starting PWM_Waveform using FlexTimers on Teensy 4.0
439-
Teensy_PWM v1.1.0
442+
Teensy_PWM v1.1.1
440443
[PWM] setupPWM: Mapping dutycycle = 0 to newDC = 0 for _resolution = 16
441444
[PWM] setupPWM: Using FlexTimer2 moduleIndex = 1 for PWM pin = 5
442445
[PWM] setPWM: _dutycycle = 0 , frequency = 2000.00
@@ -538,7 +541,7 @@ The following is the sample terminal output when running example [**PWM_Waveform
538541

539542
```cpp
540543
Starting PWM_Waveform using QuadTimers on Teensy 4.0
541-
Teensy_PWM v1.1.0
544+
Teensy_PWM v1.1.1
542545
[PWM] setupPWM: Mapping dutycycle = 0 to newDC = 0 for _resolution = 16
543546
[PWM] setupPWM: Using QuadTimer3 moduleIndex = 3 for PWM pin = 15
544547
[PWM] setPWM: _dutycycle = 0 , frequency = 2000.00
@@ -675,14 +678,24 @@ Submit issues to: [Teensy_PWM issues](https://github.com/khoih-prog/Teensy_PWM/i
675678

676679
1. Basic hardware PWM-channels for **Teensy 4.x boards, such as Teensy 4.0, Teensy 4.1, Teensy MicroMod, etc.**, using [Teensyduno core](https://www.pjrc.com/teensy/td_download.html).
677680
2. Add support to **Teensy 3.x and Teensy LC**
678-
681+
3. Add example [PWM_StepperControl](https://github.com/khoih-prog/Teensy_PWM/examples/PWM_StepperControl) to demo how to control Stepper Motor using PWM
682+
679683
---
680684
---
681685

682686
### Contributions and Thanks
683687

684688
Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.
685689

690+
1. Thanks to [Paul van Dinther](https://github.com/dinther) for proposing new way to use PWM to drive Stepper-Motor in [Using PWM to step a stepper driver #16](https://github.com/khoih-prog/RP2040_PWM/issues/16), leading to v2.0.3
691+
692+
693+
<table>
694+
<tr>
695+
<td align="center"><a href="https://github.com/dinther"><img src="https://github.com/dinther.png" width="100px;" alt="dinther"/><br /><sub><b>Paul van Dinther</b></sub></a><br /></td>
696+
</tr>
697+
</table>
698+
686699

687700
---
688701

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
1111
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
1212

13+
1314
---
1415
---
1516

1617
## Table of Contents
1718

1819
* [Changelog](#changelog)
20+
* [Releases v1.1.1](#Releases-v111)
1921
* [Releases v1.1.0](#Releases-v110)
2022
* [Initial Releases v1.0.0](#Initial-Releases-v100)
2123

@@ -24,6 +26,10 @@
2426

2527
## Changelog
2628

29+
### Releases v1.1.1
30+
31+
1. Add example [PWM_StepperControl](https://github.com/khoih-prog/Teensy_PWM/examples/PWM_StepperControl) to demo how to control Stepper Motor using PWM. Check [Using PWM to step a stepper driver #16](https://github.com/khoih-prog/RP2040_PWM/issues/16)
32+
2733
### Releases v1.1.0
2834

2935
1. Add support to **Teensy 3.x and Teensy LC**
@@ -32,3 +38,5 @@
3238

3339
1. Initial coding to support **Teensy 4.x boards, such as Teensy 4.0, Teensy 4.1, Teensy MicroMod, etc.**, using [Teensyduno core](https://www.pjrc.com/teensy/td_download.html). The support to **Teensy 2.x, Teensy LC and Teensy 3.x** will be added gradually.
3440

41+
42+

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Teensy_PWM",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"keywords": "timing, device, control, timer, interrupt, hardware, isr, isr-based, hardware-timer, mission-critical, accuracy, precise, non-blocking, teensy-2x, teensy-3x, teensy-lc, teensy-4x, teensy-41, teensy-40, teensy-micromod",
55
"description": "This library enables you to use Hardware-based PWM channels on Teensy boards, such as Teensy 2.x, Teensy LC, Teensy 3.x, Teensy 4.x, Teensy MicroMod, etc., to create and output PWM to pins. Using the same functions as other FastPWM libraries to enable you to port PWM code easily between platforms. The most important feature is they are purely hardware-based PWM channels, supporting very high PWM frequencies. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. These hardware-based PWMs, still work even if other software functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software-based PWM using ISR, millis() or micros(). That is necessary if you need to control devices requiring high precision. New efficient setPWM_manual function to facilitate waveform creation using PWM",
66
"authors":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Teensy_PWM
2-
version=1.1.0
2+
version=1.1.1
33
author=Khoi Hoang <[email protected]>
44
maintainer=Khoi Hoang <[email protected]>
55
sentence=This library enables you to use Hardware-based PWM channels on Teensy boards, such as Teensy 2.x, Teensy LC, Teensy 3.x, Teensy 4.x, Teensy MicroMod, etc., to create and output PWM to pins. Using the same functions as other FastPWM libraries to enable you to port PWM code easily between platforms.

src/PWM_Generic_Debug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
Built by Khoi Hoang https://github.com/khoih-prog/Teensy_PWM
88
Licensed under MIT license
99
10-
Version: 1.1.0
10+
Version: 1.1.1
1111
1212
Version Modified By Date Comments
1313
------- ----------- ---------- -----------
1414
1.0.0 K.Hoang 06/11/2022 Initial coding for Teensy 4.x, etc.
1515
1.1.0 K.Hoang 06/11/2022 Add support to Teensy 3.x, Teensy LC
16+
1.1.1 K.Hoang 21/01/2023 Add `PWM_StepperControl` example
1617
*****************************************************************************************************************************/
1718

1819
#pragma once

0 commit comments

Comments
 (0)