Skip to content

Commit ff8a489

Browse files
authored
update examples + GitHub actions (#57)
1 parent 1288094 commit ff8a489

File tree

32 files changed

+78
-26
lines changed

32 files changed

+78
-26
lines changed

.github/workflows/arduino-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
runs-on: ubuntu-latest
77
timeout-minutes: 5
88
steps:
9-
- uses: actions/checkout@v4
10-
- uses: arduino/arduino-lint-action@v1
9+
- uses: actions/checkout@v6
10+
- uses: arduino/arduino-lint-action@v2
1111
with:
1212
library-manager: update
1313
compliance: strict

.github/workflows/arduino_test_runner.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ jobs:
66
runTest:
77
runs-on: ubuntu-latest
88
timeout-minutes: 20
9-
109
steps:
11-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v6
1211
- uses: ruby/setup-ruby@v1
1312
with:
1413
ruby-version: 2.6

.github/workflows/jsoncheck.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
paths:
66
- '**.json'
77
pull_request:
8+
paths:
9+
- '**.json'
810

911
jobs:
1012
test:
1113
runs-on: ubuntu-latest
1214
timeout-minutes: 5
1315
steps:
14-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1517
- name: json-syntax-check
1618
uses: limitusus/json-syntax-check@v2
1719
with:

ACS712.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: ACS712.cpp
33
// AUTHOR: Rob Tillaart, Pete Thompson
4-
// VERSION: 0.3.10
4+
// VERSION: 0.4.0
55
// DATE: 2020-08-02
66
// PURPOSE: ACS712 library - current measurement
77
// URL: https://github.com/RobTillaart/ACS712

ACS712.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: ACS712.h
44
// AUTHOR: Rob Tillaart, Pete Thompson
5-
// VERSION: 0.3.10
5+
// VERSION: 0.4.0
66
// DATE: 2020-08-02
77
// PURPOSE: ACS712 library - current measurement
88
// URL: https://github.com/RobTillaart/ACS712
@@ -14,7 +14,7 @@
1414
#include "Arduino.h"
1515

1616

17-
#define ACS712_LIB_VERSION (F("0.3.10"))
17+
#define ACS712_LIB_VERSION (F("0.4.0"))
1818

1919

2020
// ACS712_FF_SINUS == 1.0/sqrt(2) == 0.5 * sqrt(2)

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.4.0] 2026-01-02
10+
- update GitHub actions
11+
- update examples
12+
- bump version number
13+
- minor edits
14+
15+
----
16+
917
## [0.3.10] - 2024-10-20
1018
- update readme.md, ESPHome #51, kudos to uTZFu
1119
- add debug example.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2024 Rob Tillaart
3+
Copyright (c) 2020-2026 Rob Tillaart
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ for this "voltage divider effect".
414414

415415
### Examples:
416416

417-
418417
For a 5 A type sensor, 185 mV/A would be the normal value.
419418
After using a voltage divider one need to adjust the mVperAmp.
420419

@@ -423,7 +422,7 @@ After using a voltage divider one need to adjust the mVperAmp.
423422
| 10200 | 4745 | 4745 / (10200 + 4745) = 0.3175 | 185 \* 0.3175 = 31.75 |
424423
| 4745 | 10200 | 10200 / (10200 + 4745) = 0.6825 | 185 \* 0.6825 = 68.25 |
425424
| 10200 | 9800 | 9800 / (10200 + 9800) = 0.4900 | 185 \* 0.4900 = 49.00 |
426-
| 1000 | 2200 | 2200 / (1000 + 2200) = 0.6875 | 185 \* 0.6875 = 127.19 | 5V -> 3V3 ADC
425+
| 1000 | 2200 | 2200 / (1000 + 2200) = 0.6875 | 185 \* 0.6875 = 127.19 | 5V -> 3V3 ADC
427426
| 300 | 75 | 75 / (300 + 75) = 0.2000 | 185 \* 0.2000 = 37.00 | 5V -> 1V ADC
428427

429428

@@ -523,7 +522,7 @@ The examples show the basic working of the functions.
523522
- need to buy extra hardware
524523

525524

526-
#### Should - 0.3.x
525+
#### Should
527526

528527
- investigate **estimateMidPoint(confidence)** See issue #35
529528
- is less blocking by spreading the sampling over many calls.
@@ -539,7 +538,7 @@ The examples show the basic working of the functions.
539538

540539
#### Could
541540

542-
- merge **mA_AC()** and **mA_AC_sampling()** into one. (0.4.0)
541+
- merge **mA_AC()** and **mA_AC_sampling()** into one
543542
- or remove - depreciate - the worst one
544543
- add range check to (all) set functions?
545544
- add unit test for **autoMidPointDC()** (needed?)

examples/ACS712_20_AC/ACS712_20_AC.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
// ACS712 30A uses 66 mV per A
1515

1616

17-
ACS712 ACS(A0, 5.0, 1023, 100);
17+
// ACS712 ACS(A0, 5.0, 1023, 100);
1818
// ESP 32 example (might requires resistors to step down the logic voltage)
19-
// ACS712 ACS(25, 3.3, 4095, 185);
19+
ACS712 ACS(25, 3.3, 4095, 185);
2020

2121

2222
uint32_t start, stop;
@@ -26,9 +26,11 @@ void setup()
2626
{
2727
Serial.begin(115200);
2828
while (!Serial);
29+
Serial.println();
2930
Serial.println(__FILE__);
3031
Serial.print("ACS712_LIB_VERSION: ");
3132
Serial.println(ACS712_LIB_VERSION);
33+
Serial.println();
3234

3335

3436
// use simulation
@@ -67,4 +69,3 @@ uint16_t signal(uint8_t p)
6769

6870

6971
// -- END OF FILE --
70-

examples/ACS712_20_AC_DEMO/ACS712_20_AC_DEMO.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: ACS712_20_AC_DEMO.ino
33
// AUTHOR: Rob Tillaart
4-
// PURPOSE: demo to set the mVperAmpere and Form FActor.
4+
// PURPOSE: demo to set the mVperAmpere and Form Factor.
55
// URL: https://github.com/RobTillaart/ACS712
66

77

@@ -23,9 +23,11 @@ void setup()
2323
{
2424
Serial.begin(115200);
2525
while (!Serial);
26+
Serial.println();
2627
Serial.println(__FILE__);
2728
Serial.print("ACS712_LIB_VERSION: ");
2829
Serial.println(ACS712_LIB_VERSION);
30+
Serial.println();
2931

3032
ACS.autoMidPoint();
3133
}

0 commit comments

Comments
 (0)