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

Commit c00fb00

Browse files
authored
v1.1.1
### Releases v1.1.1 1. Add example [**Change_Interval**](examples/Change_Interval) and [**FakeAnalogWrite**](examples/FakeAnalogWrite) 2. Bump up version to sync with other TimerInterrupt Libraries. Modify Version String.
1 parent 33d3392 commit c00fb00

25 files changed

+775
-46
lines changed

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app

README.md

Lines changed: 144 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
4444
---
4545
---
4646

47+
### Releases v1.1.1
48+
49+
1. Add example [**Change_Interval**](examples/Change_Interval) and [**FakeAnalogWrite**](examples/FakeAnalogWrite)
50+
2. Bump up version to sync with other TimerInterrupt Libraries. Modify Version String.
51+
4752
### Releases v1.0.2
4853

4954
1. Add complicated example [ISR_16_Timers_Array_Complex](examples/ISR_16_Timers_Array_Complex)
@@ -65,7 +70,7 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
6570
---
6671
---
6772

68-
## Prerequisite
73+
## Prerequisites
6974

7075
1. [`Arduino IDE 1.8.13+` for Arduino](https://www.arduino.cc/en/Main/Software)
7176
2. [`Adafruit nRF52 v0.21.0+`](https://www.adafruit.com/) for nRF52 boards such as AdaFruit Feather nRF52840 Express, NINA_B302_ublox, etc.
@@ -104,7 +109,7 @@ Another way to install is to:
104109

105110
1. Install [VS Code](https://code.visualstudio.com/)
106111
2. Install [PlatformIO](https://platformio.org/platformio-ide)
107-
3. Install [**NRF52_TimerInterrupt** library](https://platformio.org/lib/show/11399/NRF52_TimerInterrupt) by using [Library Manager](https://platformio.org/lib/show/11399/NRF52_TimerInterrupt/installation). Search for **NRF52_TimerInterrupt** in [Platform.io Author's Libraries](https://platformio.org/lib/search?query=author:%22Khoi%20Hoang%22)
112+
3. Install [**NRF52_TimerInterrupt** library](https://platformio.org/lib/show/11399/NRF52_TimerInterrupt) or [**NRF52_TimerInterrupt** library](https://platformio.org/lib/show/11399/NRF52_TimerInterrupt) by using [Library Manager](https://platformio.org/lib/show/11427/NRF52_TimerInterrupt/installation). Search for **NRF52_TimerInterrupt** in [Platform.io Author's Libraries](https://platformio.org/lib/search?query=author:%22Khoi%20Hoang%22)
108113
4. Use included [platformio.ini](platformio/platformio.ini) file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at [Project Configuration File](https://docs.platformio.org/page/projectconf.html)
109114

110115
---
@@ -365,7 +370,8 @@ void setup()
365370
8. [SwitchDebounce](examples/SwitchDebounce)
366371
9. [TimerInterruptTest](examples/TimerInterruptTest)
367372
10. [TimerInterruptLEDDemo](examples/TimerInterruptLEDDemo)
368-
373+
11. [**FakeAnalogWrite**](examples/FakeAnalogWrite). New.
374+
12. [**Change_Interval**](examples/Change_Interval). New.
369375

370376
---
371377
---
@@ -583,8 +589,8 @@ void setup()
583589
while (!Serial);
584590
585591
Serial.printf("\nStarting ISR_Timer_Complex_Ethernet on %s\n", BOARD_NAME);
586-
Serial.printf("Version : v%s\n", NRF52_TIMER_INTERRUPT_VERSION);
587-
Serial.printf("CPU Frequency = %ld MHz\n", F_CPU / 1000000);
592+
Serial.println(NRF52_TIMER_INTERRUPT_VERSION);
593+
Serial.println("CPU Frequency = " + String(F_CPU / 1000000) + " MHz");
588594
589595
// You need this timer for non-critical tasks. Avoid abusing ISR if not absolutely necessary.
590596
blynkTimer.setInterval(BLYNK_TIMER_MS, blynkDoingSomething2s);
@@ -653,7 +659,7 @@ While software timer, **programmed for 2s, is activated after 4.867s !!!**. Then
653659

654660
```
655661
Starting ISR_Timer_Complex_Ethernet on NRF52840_FEATHER
656-
Version : v1.0.2
662+
NRF52TimerInterrupt v1.1.1
657663
CPU Frequency = 64 MHz
658664
NRF52TimerInterrupt: F_CPU (MHz) = 64, Timer = NRF_TIMER2
659665
NRF52TimerInterrupt: _fre = 1000000.00, _count = 50000
@@ -741,7 +747,7 @@ blynkDoingSomething2s: Delta programmed ms = 2000, actual = 3000
741747

742748
```
743749
Starting TimerInterruptTest on NRF52840_FEATHER
744-
Version : v1.0.2
750+
NRF52TimerInterrupt v1.1.1
745751
CPU Frequency = 64 MHz
746752
NRF52TimerInterrupt: F_CPU (MHz) = 64, Timer = NRF_TIMER1
747753
NRF52TimerInterrupt: _fre = 1000000.00, _count = 1000000
@@ -779,7 +785,7 @@ Stop ITimer0, millis() = 85017
779785

780786
```
781787
Starting Argument_None on NRF52840_FEATHER
782-
Version : v1.0.2
788+
NRF52TimerInterrupt v1.1.1
783789
CPU Frequency = 64 MHz
784790
NRF52TimerInterrupt: F_CPU (MHz) = 64, Timer = NRF_TIMER1
785791
NRF52TimerInterrupt: _fre = 1000000.00, _count = 1000000
@@ -808,7 +814,7 @@ In this example, 16 independent ISR Timers are used, yet utilized just one Hardw
808814

809815
```
810816
Starting ISR_16_Timers_Array_Complex on NRF52840_FEATHER
811-
Version : 1.0.2
817+
NRF52TimerInterrupt v1.1.1
812818
CPU Frequency = 64 MHz
813819
NRF52TimerInterrupt: F_CPU (MHz) = 64, Timer = NRF_TIMER2
814820
NRF52TimerInterrupt: _fre = 1000000.00, _count = 10000
@@ -957,7 +963,7 @@ Timer : 15, programmed : 80000, actual : 80000
957963

958964
```
959965
Starting SwitchDebounce on NRF52840_FEATHER
960-
Version : v1.0.2
966+
NRF52TimerInterrupt v1.1.1
961967
CPU Frequency = 64 MHz
962968
NRF52TimerInterrupt: F_CPU (MHz) = 64, Timer = NRF_TIMER1
963969
NRF52TimerInterrupt: _fre = 1000000.00, _count = 10000
@@ -984,9 +990,137 @@ Time = 86645, Switch = Released
984990
Time = 87646, Switch = Released
985991
986992
```
993+
987994
---
995+
996+
6. The following is the sample terminal output when running example [Change_Interval](examples/Change_Interval) to demonstrate how to change Timer Interval on-the-fly
997+
998+
```
999+
Starting Change_Interval on NRF52840_FEATHER
1000+
NRF52TimerInterrupt v1.1.1
1001+
CPU Frequency = 64 MHz
1002+
Starting ITimer0 OK, millis() = 1319
1003+
Starting ITimer1 OK, millis() = 1319
1004+
Time = 10001, Timer0Count = 17, , Timer1Count = 4
1005+
Time = 20002, Timer0Count = 37, , Timer1Count = 9
1006+
Changing Interval, Timer0 = 1000, Timer1 = 4000
1007+
Time = 30003, Timer0Count = 47, , Timer1Count = 11
1008+
Time = 40004, Timer0Count = 57, , Timer1Count = 14
1009+
Changing Interval, Timer0 = 500, Timer1 = 2000
1010+
Time = 50005, Timer0Count = 77, , Timer1Count = 19
1011+
Time = 60006, Timer0Count = 97, , Timer1Count = 24
1012+
Changing Interval, Timer0 = 1000, Timer1 = 4000
1013+
Time = 70007, Timer0Count = 107, , Timer1Count = 26
1014+
Time = 80008, Timer0Count = 117, , Timer1Count = 29
1015+
Changing Interval, Timer0 = 500, Timer1 = 2000
1016+
Time = 90009, Timer0Count = 137, , Timer1Count = 34
1017+
Time = 100010, Timer0Count = 157, , Timer1Count = 39
1018+
Changing Interval, Timer0 = 1000, Timer1 = 4000
1019+
Time = 110011, Timer0Count = 167, , Timer1Count = 41
1020+
Time = 120012, Timer0Count = 177, , Timer1Count = 44
1021+
Changing Interval, Timer0 = 500, Timer1 = 2000
1022+
Time = 130013, Timer0Count = 197, , Timer1Count = 49
1023+
Time = 140014, Timer0Count = 217, , Timer1Count = 54
1024+
Changing Interval, Timer0 = 1000, Timer1 = 4000
1025+
Time = 150015, Timer0Count = 227, , Timer1Count = 56
1026+
Time = 160016, Timer0Count = 237, , Timer1Count = 59
1027+
Changing Interval, Timer0 = 500, Timer1 = 2000
1028+
Time = 170017, Timer0Count = 257, , Timer1Count = 64
1029+
Time = 180018, Timer0Count = 277, , Timer1Count = 69
1030+
```
1031+
9881032
---
9891033

1034+
7. The following is the sample terminal output when running example [FakeAnalogWrite](examples/FakeAnalogWrite) to demonstrate how to use analogWrite to many pins to overcome the limitation of nRF52 analogWrite to only 4 pins or crash. Check [**Arduino Nano 33 BLE mbed os crashes when PWM on more than 3 digital pins**](https://forum.arduino.cc/index.php?topic=715883.0)
1035+
1036+
```
1037+
Starting FakeAnalogWrite on NRF52840_FEATHER
1038+
NRF52TimerInterrupt v1.1.1
1039+
CPU Frequency = 64 MHz
1040+
Starting ITimer OK, millis() = 893
1041+
Add index 0, pin = 2, input PWM_Value=0, mapped PWM_Value= 0
1042+
Add index 1, pin = 3, input PWM_Value=0, mapped PWM_Value= 0
1043+
Add index 2, pin = 4, input PWM_Value=0, mapped PWM_Value= 0
1044+
Add index 3, pin = 5, input PWM_Value=0, mapped PWM_Value= 0
1045+
Add index 4, pin = 6, input PWM_Value=0, mapped PWM_Value= 0
1046+
Add index 5, pin = 7, input PWM_Value=0, mapped PWM_Value= 0
1047+
Add index 6, pin = 8, input PWM_Value=0, mapped PWM_Value= 0
1048+
Add index 7, pin = 9, input PWM_Value=0, mapped PWM_Value= 0
1049+
Test PWM_Value = 0, max = 255
1050+
Update index 0, pin = 2, input PWM_Value=5, mapped PWM_Value= 14
1051+
Update index 1, pin = 3, input PWM_Value=5, mapped PWM_Value= 14
1052+
Update index 2, pin = 4, input PWM_Value=5, mapped PWM_Value= 14
1053+
Update index 3, pin = 5, input PWM_Value=5, mapped PWM_Value= 14
1054+
Update index 4, pin = 6, input PWM_Value=5, mapped PWM_Value= 14
1055+
Update index 5, pin = 7, input PWM_Value=5, mapped PWM_Value= 14
1056+
Update index 6, pin = 8, input PWM_Value=5, mapped PWM_Value= 14
1057+
Update index 7, pin = 9, input PWM_Value=5, mapped PWM_Value= 14
1058+
Test PWM_Value = 5, max = 255
1059+
Update index 0, pin = 2, input PWM_Value=10, mapped PWM_Value= 27
1060+
Update index 1, pin = 3, input PWM_Value=10, mapped PWM_Value= 27
1061+
Update index 2, pin = 4, input PWM_Value=10, mapped PWM_Value= 27
1062+
Update index 3, pin = 5, input PWM_Value=10, mapped PWM_Value= 27
1063+
Update index 4, pin = 6, input PWM_Value=10, mapped PWM_Value= 27
1064+
Update index 5, pin = 7, input PWM_Value=10, mapped PWM_Value= 27
1065+
Update index 6, pin = 8, input PWM_Value=10, mapped PWM_Value= 27
1066+
Update index 7, pin = 9, input PWM_Value=10, mapped PWM_Value= 27
1067+
...
1068+
Test PWM_Value = 145, max = 255
1069+
Update index 0, pin = 2, input PWM_Value=150, mapped PWM_Value= 135
1070+
Update index 1, pin = 3, input PWM_Value=150, mapped PWM_Value= 135
1071+
Update index 2, pin = 4, input PWM_Value=150, mapped PWM_Value= 135
1072+
Update index 3, pin = 5, input PWM_Value=150, mapped PWM_Value= 135
1073+
Update index 4, pin = 6, input PWM_Value=150, mapped PWM_Value= 135
1074+
Update index 5, pin = 7, input PWM_Value=150, mapped PWM_Value= 135
1075+
Update index 6, pin = 8, input PWM_Value=150, mapped PWM_Value= 135
1076+
Update index 7, pin = 9, input PWM_Value=150, mapped PWM_Value= 135
1077+
Test PWM_Value = 150, max = 255
1078+
Update index 0, pin = 2, input PWM_Value=155, mapped PWM_Value= 137
1079+
Update index 1, pin = 3, input PWM_Value=155, mapped PWM_Value= 137
1080+
Update index 2, pin = 4, input PWM_Value=155, mapped PWM_Value= 137
1081+
Update index 3, pin = 5, input PWM_Value=155, mapped PWM_Value= 137
1082+
Update index 4, pin = 6, input PWM_Value=155, mapped PWM_Value= 137
1083+
Update index 5, pin = 7, input PWM_Value=155, mapped PWM_Value= 137
1084+
Update index 6, pin = 8, input PWM_Value=155, mapped PWM_Value= 137
1085+
Update index 7, pin = 9, input PWM_Value=155, mapped PWM_Value= 137
1086+
Test PWM_Value = 155, max = 255
1087+
Update index 0, pin = 2, input PWM_Value=160, mapped PWM_Value= 138
1088+
Update index 1, pin = 3, input PWM_Value=160, mapped PWM_Value= 138
1089+
Update index 2, pin = 4, input PWM_Value=160, mapped PWM_Value= 138
1090+
Update index 3, pin = 5, input PWM_Value=160, mapped PWM_Value= 138
1091+
Update index 4, pin = 6, input PWM_Value=160, mapped PWM_Value= 138
1092+
Update index 5, pin = 7, input PWM_Value=160, mapped PWM_Value= 138
1093+
Update index 6, pin = 8, input PWM_Value=160, mapped PWM_Value= 138
1094+
Update index 7, pin = 9, input PWM_Value=160, mapped PWM_Value= 138
1095+
Test PWM_Value = 160, max = 255
1096+
Update index 0, pin = 2, input PWM_Value=165, mapped PWM_Value= 141
1097+
Update index 1, pin = 3, input PWM_Value=165, mapped PWM_Value= 141
1098+
Update index 2, pin = 4, input PWM_Value=165, mapped PWM_Value= 141
1099+
Update index 3, pin = 5, input PWM_Value=165, mapped PWM_Value= 141
1100+
Update index 4, pin = 6, input PWM_Value=165, mapped PWM_Value= 141
1101+
Update index 5, pin = 7, input PWM_Value=165, mapped PWM_Value= 141
1102+
Update index 6, pin = 8, input PWM_Value=165, mapped PWM_Value= 141
1103+
Update index 7, pin = 9, input PWM_Value=165, mapped PWM_Value= 141
1104+
Test PWM_Value = 165, max = 255
1105+
Update index 0, pin = 2, input PWM_Value=170, mapped PWM_Value= 143
1106+
Update index 1, pin = 3, input PWM_Value=170, mapped PWM_Value= 143
1107+
Update index 2, pin = 4, input PWM_Value=170, mapped PWM_Value= 143
1108+
Update index 3, pin = 5, input PWM_Value=170, mapped PWM_Value= 143
1109+
Update index 4, pin = 6, input PWM_Value=170, mapped PWM_Value= 143
1110+
Update index 5, pin = 7, input PWM_Value=170, mapped PWM_Value= 143
1111+
Update index 6, pin = 8, input PWM_Value=170, mapped PWM_Value= 143
1112+
Update index 7, pin = 9, input PWM_Value=170, mapped PWM_Value= 143
1113+
Test PWM_Value = 170, max = 255
1114+
```
1115+
1116+
---
1117+
---
1118+
1119+
### Releases v1.1.1
1120+
1121+
1. Add example [**Change_Interval**](examples/Change_Interval) and [**FakeAnalogWrite**](examples/FakeAnalogWrite)
1122+
2. Bump up version to sync with other TimerInterrupt Libraries. Modify Version String.
1123+
9901124
### Releases v1.0.2
9911125

9921126
1. Add complicated example [ISR_16_Timers_Array_Complex](examples/ISR_16_Timers_Array_Complex)

examples/Argument_None/Argument_None.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
Based on BlynkTimer.h
2020
Author: Volodymyr Shymanskyy
2121
22-
Version: 1.0.2
22+
Version: 1.1.1
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
2626
1.0.0 K Hoang 02/11/2020 Initial coding
2727
1.0.1 K Hoang 06/11/2020 Add complicated example ISR_16_Timers_Array using all 16 independent ISR Timers.
2828
1.0.2 K Hoang 24/11/2020 Add complicated example ISR_16_Timers_Array_Complex and optimize examples
29+
1.1.1 K.Hoang 06/12/2020 Add Change_Interval example. Bump up version to sync with other TimerInterrupt Libraries
2930
*****************************************************************************************************************************/
3031

3132
/*
@@ -123,7 +124,7 @@ void setup()
123124
delay(100);
124125

125126
Serial.printf("\nStarting Argument_None on %s\n", BOARD_NAME);
126-
Serial.printf("Version : v%s\n", NRF52_TIMER_INTERRUPT_VERSION);
127+
Serial.println(NRF52_TIMER_INTERRUPT_VERSION);
127128
Serial.printf("CPU Frequency = %ld MHz\n", F_CPU / 1000000);
128129

129130
// Interval in microsecs

0 commit comments

Comments
 (0)