mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.4.1 PCA9635
This commit is contained in:
parent
8806081e03
commit
83377c9cb9
@ -2,13 +2,14 @@
|
|||||||
// FILE: PCA9635.cpp
|
// FILE: PCA9635.cpp
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// DATE: 23-apr-2016
|
// DATE: 23-apr-2016
|
||||||
// VERSION: 0.4.0
|
// VERSION: 0.4.1
|
||||||
// PURPOSE: Arduino library for PCA9635 I2C LED driver
|
// PURPOSE: Arduino library for PCA9635 I2C LED driver
|
||||||
// URL: https://github.com/RobTillaart/PCA9635
|
// URL: https://github.com/RobTillaart/PCA9635
|
||||||
//
|
//
|
||||||
// HISTORY:
|
// HISTORY:
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
// 0.4.1 2022-09-10 Fix #17 adjust begin() interface for ESP32
|
||||||
// 0.4.0 2022-05-29 breaking changes
|
// 0.4.0 2022-05-29 breaking changes
|
||||||
// rename reset() to configure()
|
// rename reset() to configure()
|
||||||
// add mode1 and mode2 parameter to configure.
|
// add mode1 and mode2 parameter to configure.
|
||||||
@ -48,7 +49,7 @@ PCA9635::PCA9635(const uint8_t deviceAddress, TwoWire *wire)
|
|||||||
|
|
||||||
|
|
||||||
#if defined (ESP8266) || defined(ESP32)
|
#if defined (ESP8266) || defined(ESP32)
|
||||||
bool PCA9635::begin(uint8_t sda, uint8_t scl, uint8_t mode1_mask, uint8_t mode2_mask)
|
bool PCA9635::begin(int sda, int scl, uint8_t mode1_mask, uint8_t mode2_mask)
|
||||||
{
|
{
|
||||||
_wire = &Wire;
|
_wire = &Wire;
|
||||||
if ((sda < 255) && (scl < 255))
|
if ((sda < 255) && (scl < 255))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// FILE: PCA9635.h
|
// FILE: PCA9635.h
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// DATE: 23-apr-2016
|
// DATE: 23-apr-2016
|
||||||
// VERSION: 0.4.0
|
// VERSION: 0.4.1
|
||||||
// PURPOSE: Arduino library for PCA9635 I2C LED driver, 16 channel
|
// PURPOSE: Arduino library for PCA9635 I2C LED driver, 16 channel
|
||||||
// URL: https://github.com/RobTillaart/PCA9635
|
// URL: https://github.com/RobTillaart/PCA9635
|
||||||
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
#include "Wire.h"
|
#include "Wire.h"
|
||||||
|
|
||||||
|
|
||||||
#define PCA9635_LIB_VERSION (F("0.4.0"))
|
#define PCA9635_LIB_VERSION (F("0.4.1"))
|
||||||
|
|
||||||
#define PCA9635_MODE1 0x00
|
#define PCA9635_MODE1 0x00
|
||||||
#define PCA9635_MODE2 0x01
|
#define PCA9635_MODE2 0x01
|
||||||
@ -70,7 +70,7 @@ public:
|
|||||||
explicit PCA9635(const uint8_t deviceAddress, TwoWire *wire = &Wire);
|
explicit PCA9635(const uint8_t deviceAddress, TwoWire *wire = &Wire);
|
||||||
|
|
||||||
#if defined (ESP8266) || defined(ESP32)
|
#if defined (ESP8266) || defined(ESP32)
|
||||||
bool begin(uint8_t sda, uint8_t scl,
|
bool begin(int sda, int scl,
|
||||||
uint8_t mode1_mask = PCA9635_MODE1_ALLCALL,
|
uint8_t mode1_mask = PCA9635_MODE1_ALLCALL,
|
||||||
uint8_t mode2_mask = PCA9635_MODE2_NONE);
|
uint8_t mode2_mask = PCA9635_MODE2_NONE);
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,7 +32,7 @@ and optional the Wire interface as parameter.
|
|||||||
- **bool begin(uint8_t mode1_mask = PCA9634_MODE1_ALLCALL, uint8_t mode2_mask = PCA9634_MODE2_NONE)**
|
- **bool begin(uint8_t mode1_mask = PCA9634_MODE1_ALLCALL, uint8_t mode2_mask = PCA9634_MODE2_NONE)**
|
||||||
initializes the library after startup. Optionally setting the MODE1 and MODE2 configuration registers.
|
initializes the library after startup. Optionally setting the MODE1 and MODE2 configuration registers.
|
||||||
See PCA9635.h and datasheet for settings possible.
|
See PCA9635.h and datasheet for settings possible.
|
||||||
- **bool begin(uint8_t sda, uint8_t scl, uint8_t mode1_mask = PCA9635_MODE1_ALLCALL, uint8_t mode2_mask = PCA9635_MODE2_NONE)**
|
- **bool begin(int sda, int scl, uint8_t mode1_mask = PCA9635_MODE1_ALLCALL, uint8_t mode2_mask = PCA9635_MODE2_NONE)**
|
||||||
idem, ESP32 ESP8266 only.
|
idem, ESP32 ESP8266 only.
|
||||||
- **void configure(uint8_t mode1_mask, uint8_t mode2_mask)**
|
- **void configure(uint8_t mode1_mask, uint8_t mode2_mask)**
|
||||||
To configure the library after startup one can set the MODE1 and MODE2 configuration registers.
|
To configure the library after startup one can set the MODE1 and MODE2 configuration registers.
|
||||||
@ -161,6 +161,7 @@ It needs more testing and if there are issues, please report.
|
|||||||
|
|
||||||
AllCall is automatically activated for each device on startup.
|
AllCall is automatically activated for each device on startup.
|
||||||
|
|
||||||
|
|
||||||
#### Description
|
#### Description
|
||||||
|
|
||||||
**SUB CALL** allows one to make groups of PCA9634 devices and control them on group level.
|
**SUB CALL** allows one to make groups of PCA9634 devices and control them on group level.
|
||||||
@ -173,6 +174,7 @@ it with **enableSubCall(nr)**.
|
|||||||
In the same way one can become member of an **ALL CALL** group.
|
In the same way one can become member of an **ALL CALL** group.
|
||||||
Typically there is only one such group but one can configure more of them by applying different addresses.
|
Typically there is only one such group but one can configure more of them by applying different addresses.
|
||||||
|
|
||||||
|
|
||||||
#### Interface
|
#### Interface
|
||||||
|
|
||||||
The functions to enable all/sub-addresses are straightforward:
|
The functions to enable all/sub-addresses are straightforward:
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/RobTillaart/PCA9635.git"
|
"url": "https://github.com/RobTillaart/PCA9635.git"
|
||||||
},
|
},
|
||||||
"version": "0.4.0",
|
"version": "0.4.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"frameworks": "arduino",
|
"frameworks": "arduino",
|
||||||
"platforms": "*",
|
"platforms": "*",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name=PCA9635
|
name=PCA9635
|
||||||
version=0.4.0
|
version=0.4.1
|
||||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||||
sentence=Arduino library for PCA9635 I2C LED driver 16 channel
|
sentence=Arduino library for PCA9635 I2C LED driver 16 channel
|
||||||
|
Loading…
Reference in New Issue
Block a user