Skip to content

Commit

Permalink
update GitHub actions (#30)
Browse files Browse the repository at this point in the history
* update license to 2023
* update GitHub actions
  • Loading branch information
RobTillaart authored Jan 3, 2023
1 parent 891cd90 commit 793130c
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/arduino-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/arduino_test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jsoncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1
with:
Expand Down
3 changes: 2 additions & 1 deletion ACS712.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//
// FILE: ACS712.cpp
// AUTHOR: Rob Tillaart, Pete Thompson
// VERSION: 0.3.2
// VERSION: 0.3.3
// DATE: 2020-08-02
// PURPOSE: ACS712 library - current measurement
// URL: https://github.com/RobTillaart/ACS712


#include "ACS712.h"
Expand Down
5 changes: 3 additions & 2 deletions ACS712.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
//
// FILE: ACS712.h
// AUTHOR: Rob Tillaart, Pete Thompson
// VERSION: 0.3.2
// VERSION: 0.3.3
// DATE: 2020-08-02
// PURPOSE: ACS712 library - current measurement
// URL: https://github.com/RobTillaart/ACS712
//
// Tested with a RobotDyn ACS712 20A breakout + UNO.
//


#include "Arduino.h"

#define ACS712_LIB_VERSION (F("0.3.2"))
#define ACS712_LIB_VERSION (F("0.3.3"))


// ACS712_FF_SINUS == 1.0/sqrt(2) == 0.5 * sqrt(2)
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Change Log AD520X
# Change Log ACS712

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.3.3] - 2023-03-01
- update GitHub actions
- update license
- add example
- add URL in .h .cpp


## [0.3.2] - 2022-11-18
- fix #26 revert data type \_midPoint to int
- Add CHANGELOG.md
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2022 Rob Tillaart
Copyright (c) 2020-2023 Rob Tillaart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,12 @@ The examples show the basic working of the functions.

## Future

#### Must


#### Should - 0.3.x

- investigate noise suppression #21 (0.3.1 and later)
- add external history file = changelog.md


#### Could
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// FILE: ACS712_20_AC_midPoint_performance.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo to compare different midPoint methods.
// URL: https://github.com/RobTillaart/ACS712


#include "ACS712.h"


// Arduino UNO has 5.0 volt with a max ADC value of 1023 steps
// ACS712 5A uses 185 mV per A
// ACS712 20A uses 100 mV per A
// ACS712 30A uses 66 mV per A


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

uint32_t start, stop;

float mp = 0;


void setup()
{
Serial.begin(115200);
while (!Serial);
Serial.println(__FILE__);
Serial.println();
Serial.print("ACS712_LIB_VERSION: ");
Serial.println(ACS712_LIB_VERSION);

Serial.println("Compare different midPoint methods.\n");

start = micros();
mp = ACS.getMidPoint();
stop = micros();
Serial.print("Default: \t");
Serial.print(mp);
Serial.print("\t");
Serial.println(stop - start);
delay(10);

start = micros();
mp = ACS.autoMidPoint();
stop = micros();
Serial.print("AutoMP: \t");
Serial.print(mp);
Serial.print("\t");
Serial.println(stop - start);
delay(10);

start = micros();
uint16_t average = (ACS.getMinimum(20) + ACS.getMaximum(20)) / 2;
stop = micros();
Serial.print("Average: \t");
Serial.print(average);
Serial.print("\t");
Serial.println(stop - start);
delay(10);

Serial.println("\ndone...");
}


void loop()
{
delay(1000);
}


// -- END OF FILE --
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/ACS712.git"
},
"version": "0.3.2",
"version": "0.3.3",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ACS712
version=0.3.2
version=0.3.3
author=Rob Tillaart <[email protected]>, Pete Thompson <[email protected]>
maintainer=Rob Tillaart <[email protected]>
sentence=ACS712 library for Arduino.
Expand Down

0 comments on commit 793130c

Please sign in to comment.