Skip to content

Commit

Permalink
update GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Mar 17, 2024
1 parent 7984026 commit acb1f45
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

github: RobTillaart

custom: "https://www.paypal.me/robtillaart"
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@v3
- uses: actions/checkout@v4
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/arduino_test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on: [push, pull_request]
jobs:
runTest:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jsoncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"

17 changes: 10 additions & 7 deletions ADG725.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
// FILE: ADG725.h
// AUTHOR: Rob Tillaart
// DATE: 2023-07-24
// VERSION: 0.1.1
// VERSION: 0.1.2
// PURPOSE: Arduino library for ADG725 - 16 to 1 channel (2x) multiplexer
// URL: https://github.com/RobTillaart/ADG725


#include "Arduino.h"

#define ADG725_LIB_VERSION (F("0.1.1"))
#define ADG725_LIB_VERSION (F("0.1.2"))

#define ADG725_ALLOFF 0x80 // ENable bit (false)
#define ADG725_A_ONLY 0x20 // retain B
Expand Down Expand Up @@ -68,8 +68,8 @@ class ADG725
{
return _channelA;
}


uint8_t getChannelB()
{
return _channelB;
Expand All @@ -93,14 +93,17 @@ class ADG725
private:
void write(uint8_t data)
{
uint8_t cl = _clockPin;
uint8_t da = _dataPin;
digitalWrite(_syncPin, LOW);
for (int i = 0; i < 8; i++)
{
// CLOCK max 30 MHz.
digitalWrite(_clockPin, HIGH);
digitalWrite(_dataPin, (data & 0x80) > 0);
digitalWrite(cl, HIGH);
// MSB first
digitalWrite(da, (data & 0x80) > 0);
data <<= 1;
digitalWrite(_clockPin, LOW);
digitalWrite(cl, LOW);
}
digitalWrite(_syncPin, HIGH);
}
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.1.2] - 2024-03-17
- update GitHub actions
- add performance example
- minor performance tweak.


## [0.1.1] - 2023-10-16
- update readme.md


## [0.1.0] - 2023-07-24
- initial version
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) 2023-2023 Rob Tillaart
Copyright (c) 2023-2024 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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ Valid values for channel are 0..15.
#### Should

- add examples
- check performance

#### Could

Expand Down
3 changes: 2 additions & 1 deletion examples/ADG725_demo/ADG725_demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ ADG725 ADG(10, 11, 12);

uint32_t start, stop;


void setup()
{
Serial.begin(115200);
Serial.print("ADG725_LIB_VERSION: ");
Serial.println(ADG725_LIB_VERSION);
delay(100);

start = micros();
for (int ch = 0; ch < 16; ch++)
{
Expand Down
60 changes: 60 additions & 0 deletions examples/ADG725_performance/ADG725_performance.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
r//
// FILE: ADG725_performance.ino
// AUTHOR: Rob Tillaart
// PURPOSE: measure performance
// URL: https://github.com/RobTillaart/ADG725


#include "ADG725.h"


ADG725 ADG(10, 11, 12);

uint32_t start, stop;


void setup()
{
Serial.begin(115200);
Serial.print("ADG725_LIB_VERSION: ");
Serial.println(ADG725_LIB_VERSION);
delay(100);

start = micros();
for (int ch = 0; ch < 16; ch++)
{
ADG.setChannel(ch);
}
stop = micros();
Serial.print("setChannel:\t");
Serial.println((stop - start) / 16.0);
delay(100);

start = micros();
for (int ch = 0; ch < 16; ch++)
{
ADG.setChannelA(ch);
}
stop = micros();
Serial.print("setChannelA:\t");
Serial.println((stop - start) / 16.0);
delay(100);

start = micros();
for (int ch = 0; ch < 16; ch++)
{
ADG.setChannelB(ch);
}
stop = micros();
Serial.print("setChannelB:\t");
Serial.println((stop - start) / 16.0);
delay(100);
}


void loop()
{
}


// -- END OF FILE --
7 changes: 7 additions & 0 deletions examples/ADG725_performance/performance_0.1.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Arduino UNO
IDE:1.8.19

ADG725_LIB_VERSION: 0.1.1
setChannel: 125.25
setChannelA: 125.00
setChannelB: 125.25
8 changes: 8 additions & 0 deletions examples/ADG725_performance/performance_0.1.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Arduino UNO
IDE:1.8.19

ADG725_LIB_VERSION: 0.1.2
setChannel: 124.50
setChannelA: 124.25
setChannelB: 124.25

2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/ADG725"
},
"version": "0.1.1",
"version": "0.1.2",
"license": "MIT",
"frameworks": "*",
"platforms": "*",
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=ADG725
version=0.1.1
version=0.1.2
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for ADG725 - 16 to 1 channel (2x) multiplexer.
paragraph=
paragraph=
category=Signal Input/Output
url=https://github.com/RobTillaart/ADG725
architectures=*
Expand Down

0 comments on commit acb1f45

Please sign in to comment.