0.2.1 ADT7470

This commit is contained in:
Rob Tillaart 2024-04-06 10:02:25 +02:00
parent 1df73f732a
commit 7c0b2de80f
12 changed files with 35 additions and 29 deletions

View File

@ -1,4 +1,5 @@
# These are supported funding model platforms
github: RobTillaart
github: RobTillaart
custom: "https://www.paypal.me/robtillaart"

View File

@ -5,8 +5,9 @@ on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update

View File

@ -1,4 +1,4 @@
---
name: Arduino CI
on: [push, pull_request]
@ -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

View File

@ -9,10 +9,11 @@ on:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
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$"

View File

@ -1,7 +1,7 @@
//
// FILE: ADT7470.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.2.0
// VERSION: 0.2.1
// PURPOSE: Arduino library for I2C ADT7470 Fan Monitoring
// URL: https://github.com/RobTillaart/ADT7470
// http://forum.arduino.cc/index.php?topic=363218.0

View File

@ -2,17 +2,16 @@
//
// FILE: ADT7470.h
// AUTHOR: Rob Tillaart
// VERSION: 0.2.0
// VERSION: 0.2.1
// PURPOSE: Arduino library for I2C ADT7470 Fan Monitoring
// URL: https://github.com/RobTillaart/ADT7470
// http://forum.arduino.cc/index.php?topic=363218.0
#include "Arduino.h"
#include "Wire.h"
#define ADT7470_LIB_VERSION (F("0.2.0"))
#define ADT7470_LIB_VERSION (F("0.2.1"))
#ifndef ADT7470_TIMEOUT
#define ADT7470_TIMEOUT 1000

View File

@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.2.1] - 2023-04-06
- update GitHub actions
- minor edits
## [0.2.0] - 2023-10-13
- add support for Wire1 etc (ESP32)
- add CHANGELOG.md

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2015-2023 Rob Tillaart
Copyright (c) 2015-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

View File

@ -41,11 +41,11 @@ inductive pulse when switched off. (see also datasheet).
(from datasheet)
| Pin 11 | (ADDR) State | Address |
|:----------------------|:------------:|:---------------------------------------------:|
| High (10 kΩ to VCC) | 010 1111 | (0x5E left-justified or 0x2F right-justified) |
| Low (10 kΩ to GND) | 010 1100 | (0x58 left-justified or 0x2C right-justified) |
| Floating (no pull-up) | 010 1110 | (0x5C left-justified or 0x2E right-justified) |
| Pin 11 | (ADDR) State | Address |
|:------------------------|:------------:|:---------------------------------------------:|
| HIGH (10 kΩ to VCC) | 010 1111 | 0x5E left-justified or 0x2F right-justified |
| LOW (10 kΩ to GND) | 010 1100 | 0x58 left-justified or 0x2C right-justified |
| Floating (no pull-up) | 010 1110 | 0x5C left-justified or 0x2E right-justified |
## Interface
@ -54,10 +54,10 @@ inductive pulse when switched off. (see also datasheet).
#include "ADT7470.h"
```
The interface consists of:
Check datasheet for the details as this section needs to be elaborated.
- **ADT7470()** constructor
- **void begin()** initialize the I2C bus
- **ADT7470(uint8_t address, TwoWire \*wire = &Wire)** constructor, with default I2C bus.
- **void begin()** initialize the library
- **bool isConnected()** check if the module is connected to the I2C bus
- **void startMonitoring()**
- **void stopMonitoring()**
@ -78,15 +78,15 @@ The interface consists of:
of sensor index. Temperature sensors are daisy changed.
- **int8_t getMaxTemperature()** get max temperature of connected temperature sensors.
- **bool setTemperatureLimit(uint8_t index, int8_t low, int8_t high)** for ALARM function
- **int8_t getTemperatureLowLimit(uint8_t index)**
- **int8_t getTemperatureHighLimit(uint8_t index)**
- **int8_t getTemperatureLowLimit(uint8_t index)** return the set value. Default ?
- **int8_t getTemperatureHighLimit(uint8_t index)** return the set value. Default ?
#### PWM
- **bool setPWM(uint8_t index, uint8_t value)** set the speed of the fan at index
- **uint8_t getPWM(uint8_t index)** read back the speed set.
- **bool setFanLowFreq(value = 0)**
- **bool setFanLowFreq(value = 0)** set PWM frequency.
- **bool setFanHighFreq(value = 0)**
- **void setInvertPWM(uint8_t index)**
- **uint8_t getInvertPWM(uint8_t index)**

View File

@ -4,7 +4,6 @@
// PURPOSE: demo ADT7470 library
#include <Wire.h>
#include "ADT7470.h"
ADT7470 ADT(ADT7470_ADDR_FLOAT); // default Wire
@ -18,8 +17,8 @@ void setup()
Serial.println("ADT7470_LIB_VERSION: ");
Serial.println(ADT7470_LIB_VERSION);
Serial.println();
Wire.begin();
Serial.begin(115200);
@ -41,7 +40,6 @@ void setup()
testTach();
testFanSpeed();
testStop();
}
Serial.println("Done");
@ -141,7 +139,7 @@ void testTach()
ADT.setPulsesPerRevolution(i, ppr[i]);
bool b = (ppr[i] == ADT.getPulsesPerRevolution(i));
Serial.print("\t");
Serial.print(b ? "T" : "F"); // expect TTTT
Serial.print(b ? "T" : "F"); // expect TTTT
}
Serial.println();

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/ADT7470.git"
},
"version": "0.2.0",
"version": "0.2.1",
"license": "MIT",
"frameworks": "*",
"platforms": "*",

View File

@ -1,5 +1,5 @@
name=ADT7470
version=0.2.0
version=0.2.1
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=ADT7470 Library