From d951a8f2d4c03c2385b906131b89be5cfbdaade6 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Sat, 23 Sep 2023 21:10:03 +0200 Subject: [PATCH] 0.2.1 M5ROTATE8 --- libraries/M5ROTATE8/CHANGELOG.md | 7 ++++++ libraries/M5ROTATE8/README.md | 13 ++++++++++ .../M5ROTATE8_led_demo/M5ROTATE8_led_demo.ino | 25 ++++++++++++++++--- libraries/M5ROTATE8/keywords.txt | 2 ++ libraries/M5ROTATE8/library.json | 2 +- libraries/M5ROTATE8/library.properties | 2 +- libraries/M5ROTATE8/m5rotate8.cpp | 4 +-- libraries/M5ROTATE8/m5rotate8.h | 4 +-- 8 files changed, 48 insertions(+), 11 deletions(-) diff --git a/libraries/M5ROTATE8/CHANGELOG.md b/libraries/M5ROTATE8/CHANGELOG.md index dcc00632..9e969de9 100644 --- a/libraries/M5ROTATE8/CHANGELOG.md +++ b/libraries/M5ROTATE8/CHANGELOG.md @@ -6,6 +6,12 @@ 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-09-23 +- add Wire1 support for ESP32 +- update readme.md +- update keywords.txt + + ## [0.2.0] 2023-08-08 - testing with hardware led to a major upgrade - fix keyPressed @@ -17,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - update readme.md - minor edits +---- ## [0.1.0] - 2023-08-03 - initial version diff --git a/libraries/M5ROTATE8/README.md b/libraries/M5ROTATE8/README.md index b8d85741..3d0e97bf 100644 --- a/libraries/M5ROTATE8/README.md +++ b/libraries/M5ROTATE8/README.md @@ -2,8 +2,11 @@ [![Arduino CI](https://github.com/RobTillaart/M5ROTATE8/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino-lint](https://github.com/RobTillaart/M5ROTATE8/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/M5ROTATE8/actions/workflows/arduino-lint.yml) [![JSON check](https://github.com/RobTillaart/M5ROTATE8/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/M5ROTATE8/actions/workflows/jsoncheck.yml) +[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/M5ROTATE8.svg)](https://github.com/RobTillaart/M5ROTATE8/issues) + [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/M5ROTATE8/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/RobTillaart/M5ROTATE8.svg?maxAge=3600)](https://github.com/RobTillaart/M5ROTATE8/releases) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/M5ROTATE8.svg)](https://registry.platformio.org/libraries/robtillaart/M5ROTATE8) # M5ROTATE8 @@ -126,6 +129,7 @@ channel = 0..8 - investigate step size 2 / 1. - An easy patch: divide by 2 resulting in step size 1 or 0 + #### Should - error handling @@ -149,3 +153,12 @@ channel = 0..8 #### Wont (unless) +## Support + +If you appreciate my libraries, you can support the development and maintenance. +Improve the quality of the libraries by providing issues and Pull Requests, or +donate through PayPal or GitHub sponsors. + +Thank you, + + diff --git a/libraries/M5ROTATE8/examples/M5ROTATE8_led_demo/M5ROTATE8_led_demo.ino b/libraries/M5ROTATE8/examples/M5ROTATE8_led_demo/M5ROTATE8_led_demo.ino index 228baf6e..633b939e 100644 --- a/libraries/M5ROTATE8/examples/M5ROTATE8_led_demo/M5ROTATE8_led_demo.ino +++ b/libraries/M5ROTATE8/examples/M5ROTATE8_led_demo/M5ROTATE8_led_demo.ino @@ -10,6 +10,10 @@ M5ROTATE8 MM; +uint8_t R = 0, G = 0, B = 0; // colors +uint16_t D = 0; // delay + + void setup() { Serial.begin(115200); @@ -26,12 +30,25 @@ void loop() { for (int ch = 0; ch < 9; ch++) { + D = 1 + (abs(MM.getAbsCounter(0)) & 0xFF); + R = MM.getAbsCounter(1) & 0x7F; + G = MM.getAbsCounter(2) & 0x7F; + B = MM.getAbsCounter(3) & 0x7F; + Serial.print(ch); - MM.writeRGB(ch, 0, 0, 255); - delay(MM.getAbsCounter(0)); + Serial.print('\t'); + Serial.print(R); + Serial.print('\t'); + Serial.print(G); + Serial.print('\t'); + Serial.print(B); + Serial.print('\t'); + Serial.println(D); + + MM.writeRGB(ch, R, G, B); + delay(D); MM.writeRGB(ch, 0, 0, 0); - delay(MM.getAbsCounter(0)); - Serial.println(MM.getAbsCounter(0)); + delay(D); } } diff --git a/libraries/M5ROTATE8/keywords.txt b/libraries/M5ROTATE8/keywords.txt index 64124513..6faf436a 100644 --- a/libraries/M5ROTATE8/keywords.txt +++ b/libraries/M5ROTATE8/keywords.txt @@ -7,6 +7,7 @@ M5ROTATE8 KEYWORD1 # Methods and Functions (KEYWORD2) begin KEYWORD2 isConnected KEYWORD2 + setAddress KEYWORD2 getAddress KEYWORD2 getVersion KEYWORD2 @@ -21,6 +22,7 @@ resetAll KEYWORD2 inputSwitch KEYWORD2 writeRGB KEYWORD2 +setAll KEYWORD2 allOff KEYWORD2 diff --git a/libraries/M5ROTATE8/library.json b/libraries/M5ROTATE8/library.json index 581c4f41..96bccc76 100644 --- a/libraries/M5ROTATE8/library.json +++ b/libraries/M5ROTATE8/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/M5ROTATE8" }, - "version": "0.2.0", + "version": "0.2.1", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/M5ROTATE8/library.properties b/libraries/M5ROTATE8/library.properties index 82a30d94..72e958b9 100644 --- a/libraries/M5ROTATE8/library.properties +++ b/libraries/M5ROTATE8/library.properties @@ -1,5 +1,5 @@ name=M5ROTATE8 -version=0.2.0 +version=0.2.1 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for M5 8ROTATE 8x rotary encoders diff --git a/libraries/M5ROTATE8/m5rotate8.cpp b/libraries/M5ROTATE8/m5rotate8.cpp index ae914b13..0033d6b6 100644 --- a/libraries/M5ROTATE8/m5rotate8.cpp +++ b/libraries/M5ROTATE8/m5rotate8.cpp @@ -1,7 +1,7 @@ // // FILE: m5rotate8.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.2.0 +// VERSION: 0.2.1 // PURPOSE: Arduino library for M5 8ROTATE 8x rotary encoders // URL: https://github.com/RobTillaart/M5ROTATE8 @@ -29,7 +29,6 @@ M5ROTATE8::M5ROTATE8(uint8_t address, TwoWire *wire) #if defined (ESP8266) || defined(ESP32) bool M5ROTATE8::begin(int dataPin, int clockPin) { - _wire = &Wire; if ((dataPin < 255) && (clockPin < 255)) { _wire->begin(dataPin, clockPin); @@ -255,5 +254,4 @@ uint32_t M5ROTATE8::read32(uint8_t reg) } - // -- END OF FILE -- diff --git a/libraries/M5ROTATE8/m5rotate8.h b/libraries/M5ROTATE8/m5rotate8.h index 64f6be6b..83f6dc09 100644 --- a/libraries/M5ROTATE8/m5rotate8.h +++ b/libraries/M5ROTATE8/m5rotate8.h @@ -2,7 +2,7 @@ // // FILE: m5rotate8.h // AUTHOR: Rob Tillaart -// VERSION: 0.2.0 +// VERSION: 0.2.1 // PURPOSE: Arduino library for M5 8ROTATE 8x rotary encoders // URL: https://github.com/RobTillaart/M5ROTATE8 @@ -10,7 +10,7 @@ #include "Arduino.h" #include "Wire.h" -#define M5ROTATE8_LIB_VERSION (F("0.2.0")) +#define M5ROTATE8_LIB_VERSION (F("0.2.1")) #define M5ROTATE8_DEFAULT_ADDRESS 0x41