Skip to content

Commit

Permalink
Updated the LED Ring description
Browse files Browse the repository at this point in the history
  • Loading branch information
Fattoresaimon committed Apr 19, 2022
1 parent 310f7d6 commit fb9cf51
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 88 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

In this repository there is a library collection of the DuPPa boards for the Arduino IDE.

All the boards are available on [Tindie!](https://www.tindie.com/stores/Saimon/)
All the boards are available on [DuPPa Store!](https://www.duppa.net/product-category/i2c-devices/)



Expand All @@ -12,7 +12,7 @@ Currently supported boards:
- [I2C NavKey](https://github.com/Fattoresaimon/I2CNavKey) Library description [here](https://github.com/Fattoresaimon/ArduinoDuPPaLib/blob/master/examples/I2CNavKey/README.md)
- [I2C Encoder Mini](https://github.com/Fattoresaimon/I2CEncoderMini) Library description [here](https://github.com/Fattoresaimon/ArduinoDuPPaLib/blob/master/examples/I2CEncoderMini/README.md)
- [RGB LED Ring](https://github.com/Fattoresaimon/RGB_LED_Ring) Library description [here](https://github.com/Fattoresaimon/ArduinoDuPPaLib/blob/master/examples/RGB%20LED%20Ring/README.md)

- [RGB LED Ring Small](https://github.com/Fattoresaimon/RGB_LED_Ring_Small) Library description [here](https://github.com/Fattoresaimon/ArduinoDuPPaLib/blob/master/examples/RGB%20LED%20Ring%20Small/README.md)


## Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@
#include "LEDRingSmall.h"

/*
Connections with Arduino UNO:
- -> GND
+ -> 5V
SDA -> A4
SCL -> A5
INT -> A3
Board Pinout
+-----+--------+----------+-------------+
| Pin | Color | Function | Arduino pin |
+-----+--------+----------+-------------+
| 1 | Red | VCC | +5V |
| 2 | Black | GND | GND |
| 3 | Yellow | VIO | +5V |
| 4 | Green | SDA | A4 |
| 5 | Blue | SCL | A5 |
+-----+--------+----------+-------------+
*/

const uint32_t fade1_table[24] = {0x8011EE, 0xA004DA, 0xBF00BF, 0xDA04A0, 0xEE1180, 0xFB255F, 0xFF4040, 0xFB5F25, 0xEE8011, 0xDAA004, 0xBFBF00, 0xA0DA04, 0x80EE11, 0x5FFB25, 0x40FF40, 0x25FB5F, 0x11EE80, 0x04DAA0, 0x00BFBF, 0x04A0DA, 0x1180EE, 0x255FFB, 0x4040FF, 0x5F25FB};
const uint32_t fade2_table[24] = {0xFF0000, 0xFF0004, 0xFF0020, 0xFF006B, 0xFF00FF, 0x6B00FF, 0x2000FF, 0x0400FF, 0x0000FF, 0x0004FF, 0x0020FF, 0x006BFF, 0x00FFFF, 0x00FF6B, 0x00FF20, 0x00FF04, 0x00FF00, 0x04FF00, 0x20FF00, 0x6BFF00, 0xFFFF00, 0xFF6B00, 0xFF2000, 0xFF0400};
static uint8_t j = 0;
static uint8_t i = 0;
static uint16_t tim = 0;
static uint8_t r = 5, g = 8, b = 20, rg = 40, br = 35, bg = 17;

LEDRingSmall LEDRingSmall(0x60);
LEDRingSmall LEDRingSmall(ISSI3746_SJ2 | ISSI3746_SJ7);//Only SJ2 and SJ7 are soldered in this example
// Also check if there are the pull-UP resistors on the I2C bus. If no or the board doesn't want to work please also solder the jumper SJ9

void setup(void) {

Expand Down
100 changes: 60 additions & 40 deletions examples/RGB LED Ring Small/README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,82 @@
# RGB LED Ring Arduino Library
# RGB LED Ring Small Arduino Library

--------------------------------------------------------------------------------

## Introduction

Here you can find the library description of the [RGB LED Ring](https://github.com/Fattoresaimon/RGB_LED_Ring) for the Arduino IDE.
The RGB LED Ring is based on the driver ISSI [IS31FL3737 ](http://www.issi.com/WW/pdf/31FL3737.pdf), for more functionality please check the datasheet of the driver.
Here you can find the project description of the [RGB LED Ring Small](https://github.com/Fattoresaimon/RGB_LED_Ring_Small).
The RGB LED Ring is based on the driver ISSI [IS31FL3746A](https://www.lumissil.com/assets/pdf/core/IS31FL3746A_DS.pdf), for more functionality please check the datasheet of the driver.
At the moment the breathing effect are not implemented.

The RGB LED Ring is available on [Tindie!]( https://www.tindie.com/products/20279/)
The RGB LED Ring is available on [DuPPa Store!](https://www.duppa.net/shop/rgb-led-ring-small/)

## Initialization of the class

The library makes available the class **LEDRing**
To initialize the library, you have to declare an instance of the class **LEDRing** for each LED Ring.
The library makes available the class **LEDRingSmall**
To initialize the library, you have to declare an instance of the class **LEDRingSmall** for each LED Ring.
For example:

``` C++
LEDRing LEDRing(0x5A);
LEDRingSmall LEDRingSmall(ISSI3746_SJ2 | ISSI3746_SJ7);
```
Declaration of the RGB LED Ring with the jumper 0x5A soldered
Declaration of the RGB LED Ring with the jumper SJ2 and SJ7 soldered.
The RGB LED Ring v1.1 it have 8 Jumpers for setting the address, they are divided in 2 groups of 4 jumpers. Only 1 jumper per group should be soldered, this make 16 possible combinations.
Possible combination are the following:
| Jumper first group | Jumper second group | I2C Address |
| ------------ | ------------ | :--: |
| ISSI3746_SJ1 | ISSI3746_SJ5 | 0x60 |
| ISSI3746_SJ2 | ISSI3746_SJ5 | 0x62 |
| ISSI3746_SJ3 | ISSI3746_SJ5 | 0x64 |
| ISSI3746_SJ4 | ISSI3746_SJ5 | 0x66 |
| ISSI3746_SJ1 | ISSI3746_SJ6 | 0x68 |
| ISSI3746_SJ2 | ISSI3746_SJ6 | 0x6A |
| ISSI3746_SJ3 | ISSI3746_SJ6 | 0x6C |
| ISSI3746_SJ4 | ISSI3746_SJ6 | 0x6E |
| ISSI3746_SJ1 | ISSI3746_SJ7 | 0x70 |
| ISSI3746_SJ2 | ISSI3746_SJ7 | 0x72 |
| ISSI3746_SJ3 | ISSI3746_SJ7 | 0x74 |
| ISSI3746_SJ4 | ISSI3746_SJ7 | 0x76 |
| ISSI3746_SJ1 | ISSI3746_SJ8 | 0x78 |
| ISSI3746_SJ2 | ISSI3746_SJ8 | 0x7A |
| ISSI3746_SJ3 | ISSI3746_SJ8 | 0x7C |
| ISSI3746_SJ4 | ISSI3746_SJ8 | 0x7E |
## Configuration
### void LEDRing_Reset(void)
Reset all the IS31FL3737 to the default state
### void LEDRingSmall_Reset(void)
Reset all the IS31FL3746A to the default state
### void LEDRing_Configuration(uint8_t conf)
This method write the register ad the address 00h of the IS31FL3737. Please refer the datasheet for further information.
This method write the register ad the address 50h of the IS31FL3746A. Please refer the datasheet for further information.
### void LEDRing_GlobalCurrent(uint8_t conf)
This method write the register 01h and it set the LEDs current.
This method write the register 51h and it set the LEDs current.
It's possible to set up to 256 step from 0 to 0xFF.
Higher value make the LEDs brighter.
### void LEDRing_PULLUP(uint8_t pull)
### void LEDRing_PULLDOWN(uint8_t pull)
Configure the PULLUP or PULLDOWN resistor.
This resistor are used for avoid the "ghost" effect in a matrix LED architecture.
The possible value are the following:
| PUR / PDR | Value |
| :--: | ---- |
| 000 | No pull-up resistor |
| 001 | 0.5kΩ |
| 010 | 1.0kΩ |
| 011 | 2.0kΩ |
| 100 | 4.0kΩ |
| 101 | 8.0kΩ |
| 110 | 16kΩ |
| 111 | 32kΩ |
### void LEDRing_EnableAllOutput(void)
This method enable all the LEDs, by default the LEDs are disabled.
### void LEDRing_DisableAllOutput(void)
This method disable all the LEDs.
### void LEDRing_SetScaling(uint8_t led_n, uint8_t scal);
Set the output current of each single color led. **n** is the LED number ( 1 to 72 ), **scal** is the scaling value (0 to 256)
### void LEDRing_SetScaling(uint8_t scal);
Set the output current of all LED. **scal** is the scaling value (0 to 256)
### void LEDRing_PULLUP_DOWN(uint8_t pull)
Configure the PULLUP and PULLDOWN resistor. You can refer to the IS31FL3746A datasheet at the 52h register for further information.
### void LEDRingSmall_SpreadSpectrum(uint8_t spread);
Enable and configure the spread spectrum functionality. You can refer to the IS31FL3746A datasheet at the 60h register for further information.
### void LEDRingSmall_PWMFrequencyEnable(uint8_t PWMenable);
Enable or Disable the PWM output. Write 1 for enable the PWM output, write 0 for disable the PWM output.
### void LEDRingSmall_PWMFrequencySetting(uint8_t pwmfreq);
Configure the PWM frequency. It's possible to configure the PWM frequency from 29kHz to 453Hz. You can refer to the IS31FL3746A datasheet at the E2h register for further information.
### uint8_t LEDRing_Temperature(void);
Get the temperature status register. Refer to the IS31FL3746A datasheet at the 24h register for further information.
### void LEDRing_PWM_MODE(void)
This method set all the LEDs in PWM mode.
Expand All @@ -66,25 +86,25 @@ This method set the PWM value to 0 for each LED.
### void LEDRing_Set_RGB(uint8_t led_n, uint32_t color)
Set the RGB color for a specific LED.
**n** is the LED number ( 0 to 47 ), while the **color** is the RGB color in 24bit format.
**n** is the LED number ( 0 to 23 ), while the **color** is the RGB color in 24bit format.
#### Examples:
```C++
LEDRing.LEDRing_Set_RGB(10, 0xFF9933);
LEDRingSmall.LEDRingSmall_Set_RGB(10, 0xFF9933);
```

### void LEDRing_Set_RED(uint8_t led_n, uint8_t color)
### void LEDRing_Set_GREEN(uint8_t led_n, uint8_t color)
### void LEDRing_Set_BLUE(uint8_t led_n, uint8_t color)

Set a specific color to a specific LED
**n** is the LED number ( 0 to 47 ), while the **color** is the color in 8bit format.
**n** is the LED number ( 0 to 24 ), while the **color** is the color in 8bit format.

#### Examples:

```C++
LEDRing.LEDRing_Set_RED(4, 128);
LEDRing.LEDRing_Set_GREEN(5, 200);
LEDRing.LEDRing_Set_BLUE(6, 80);
LEDRingSmall.LEDRingSmall_Set_RED(4, 128);
LEDRingSmall.LEDRingSmall_Set_GREEN(5, 200);
LEDRingSmall.LEDRingSmall_Set_BLUE(6, 80);
```
22 changes: 13 additions & 9 deletions examples/RGB LED Ring/LEDRing_Demo/LEDRing_Demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@


/*
Connections with Arduino UNO:
- -> GND
+ -> 5V
SDA -> A4
SCL -> A5
INT -> A3
Board Pinout
+-----+--------+----------+-------------+
| Pin | Color | Function | Arduino pin |
+-----+--------+----------+-------------+
| 1 | Red | VCC | +5V |
| 2 | Black | GND | GND |
| 3 | Yellow | VIO | +5V |
| 4 | Green | SDA | A4 |
| 5 | Blue | SCL | A5 |
+-----+--------+----------+-------------+
*/

const uint32_t fade1_table[48] = {0x8011EE, 0x900AE5, 0xA004DA, 0xB001CD, 0xBF00BF, 0xCD01B0, 0xDA04A0, 0xE50A90, 0xEE1180, 0xF51A6F, 0xFB255F, 0xFE324F, 0xFF4040, 0xFE4F32, 0xFB5F25, 0xF56F1A, 0xEE8011, 0xE5900A, 0xDAA004, 0xCDB001, 0xBFBF00, 0xB0CD01, 0xA0DA04, 0x90E50A, 0x80EE11, 0x6FF51A, 0x5FFB25, 0x4FFE32, 0x40FF40, 0x32FE4F, 0x25FB5F, 0x1AF56F, 0x11EE80, 0x0AE590, 0x04DAA0, 0x01CDB0, 0x00BFBF, 0x01B0CD, 0x04A0DA, 0x0A90E5, 0x1180EE, 0x1A6FF5, 0x255FFB, 0x324FFE, 0x4040FF, 0x4F32FE, 0x5F25FB, 0x6F1AF5, };
Expand All @@ -19,7 +22,8 @@ static uint8_t i = 0;
static uint16_t tim = 0;
static uint8_t r = 5, g = 8, b = 20, rg = 40, br = 35, bg = 17;

LEDRing LEDRing(ISSI3745_SJ1 | ISSI3745_SJ5);
LEDRing LEDRing(ISSI3745_SJ1 | ISSI3745_SJ5); //Only SJ1 and SJ5 are soldered in this example
// Also check if there are the pull-UP resistors on the I2C bus. If no or the board doesn't want to work please also solder the jumper SJ9

void setup(void) {

Expand Down Expand Up @@ -173,4 +177,4 @@ void loop() {
delay(1000);
LEDRing.LEDRing_PWM_MODE();

}
}
69 changes: 40 additions & 29 deletions examples/RGB LED Ring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

## Introduction

Here you can find the library description of the [RGB LED Ring](https://github.com/Fattoresaimon/RGB_LED_Ring) for the Arduino IDE.
The RGB LED Ring is based on the driver ISSI [IS31FL3737 ](http://www.issi.com/WW/pdf/31FL3737.pdf), for more functionality please check the datasheet of the driver.
Here you can find the project description of the [RGB LED Ring Small](https://github.com/Fattoresaimon/RGB_LED_Ring).
The RGB LED Ring is based on the driver ISSI [IS31FL3745](https://www.lumissil.com/assets/pdf/core/IS31FL3745_DS.pdf), for more functionality please check the datasheet of the driver.
At the moment the breathing effect are not implemented.

The RGB LED Ring is available on [Tindie!]( https://www.tindie.com/products/20279/)
The RGB LED Ring is available on [DuPPa Store!](https://www.duppa.net/shop/rgb-led-ring/)

## Initialization of the class

Expand All @@ -17,46 +17,57 @@ To initialize the library, you have to declare an instance of the class **LEDRin
For example:

``` C++
LEDRing LEDRing(0x5A);
LEDRing LEDRing(ISSI3745_SJ1 | ISSI3745_SJ5);
```
Declaration of the RGB LED Ring with the jumper 0x5A soldered
Declaration of the RGB LED Ring with the jumper SJ1 and SJ5 soldered.
The RGB LED Ring v1.1 it have 8 Jumpers for setting the address, they are divided in 2 groups of 4 jumpers. Only 1 jumper per group should be soldered, this make 16 possible combinations.
Possible combination are the following:
| Jumper first group | Jumper second group | I2C Address |
| ------------ | ------------ | :--: |
| ISSI3745_SJ1 | ISSI3745_SJ5 | 0x40 |
| ISSI3745_SJ2 | ISSI3745_SJ5 | 0x42 |
| ISSI3745_SJ3 | ISSI3745_SJ5 | 0x44 |
| ISSI3745_SJ4 | ISSI3745_SJ5 | 0x46 |
| ISSI3745_SJ1 | ISSI3745_SJ6 | 0x48 |
| ISSI3745_SJ2 | ISSI3745_SJ6 | 0x4A |
| ISSI3745_SJ3 | ISSI3745_SJ6 | 0x4C |
| ISSI3745_SJ4 | ISSI3745_SJ6 | 0x4E |
| ISSI3745_SJ1 | ISSI3745_SJ7 | 0x50 |
| ISSI3745_SJ2 | ISSI3745_SJ7 | 0x52 |
| ISSI3745_SJ3 | ISSI3745_SJ7 | 0x54 |
| ISSI3745_SJ4 | ISSI3745_SJ7 | 0x56 |
| ISSI3745_SJ1 | ISSI3745_SJ8 | 0x58 |
| ISSI3745_SJ2 | ISSI3745_SJ8 | 0x5A |
| ISSI3745_SJ3 | ISSI3745_SJ8 | 0x5C |
| ISSI3745_SJ4 | ISSI3745_SJ8 | 0x5E |
## Configuration
### void LEDRing_Reset(void)
Reset all the IS31FL3737 to the default state
Reset all the IS31FL3745 to the default state
### void LEDRing_Configuration(uint8_t conf)
This method write the register ad the address 00h of the IS31FL3737. Please refer the datasheet for further information.
This method write the register ad the address 00h of the IS31FL3745. Please refer the datasheet for further information.
### void LEDRing_GlobalCurrent(uint8_t conf)
This method write the register 01h and it set the LEDs current.
It's possible to set up to 256 step from 0 to 0xFF.
Higher value make the LEDs brighter.
### void LEDRing_PULLUP(uint8_t pull)
### void LEDRing_PULLDOWN(uint8_t pull)
Configure the PULLUP or PULLDOWN resistor.
This resistor are used for avoid the "ghost" effect in a matrix LED architecture.
The possible value are the following:
| PUR / PDR | Value |
| :--: | ---- |
| 000 | No pull-up resistor |
| 001 | 0.5kΩ |
| 010 | 1.0kΩ |
| 011 | 2.0kΩ |
| 100 | 4.0kΩ |
| 101 | 8.0kΩ |
| 110 | 16kΩ |
| 111 | 32kΩ |
### void LEDRing_EnableAllOutput(void)
This method enable all the LEDs, by default the LEDs are disabled.
### void LEDRing_DisableAllOutput(void)
This method disable all the LEDs.
### void LEDRing_SetScaling(uint8_t led_n, uint8_t scal);
Set the output current of each led. **n** is the LED number ( 1 to 144 ), **scal** is the scaling value (0 to 256)
### void LEDRing_SetScaling(uint8_t scal);
Set the output current of all LED. **scal** is the scaling value (0 to 256)
### void LEDRing_PULLUP_DOWN(uint8_t pull)
Configure the PULLUP and PULLDOWN resistor. You can refer to the IS31FL3745 datasheet at the 02h register for further information.
### uint8_t LEDRing_Temperature(void);
Get the temperature status register. Refer to the IS31FL3745 datasheet at the 24h register for further information.
### void LEDRing_PWM_MODE(void)
This method set all the LEDs in PWM mode.
Expand Down

0 comments on commit fb9cf51

Please sign in to comment.