• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Interfacing modules to WLED

Q&A Forum › Interfacing modules to WLED
0 Vote Up Vote Down
William Lucid asked 1 month ago

Thoughts on how to proceed with interfacing APDS9960 Gesture Module. Device is I²C.
Is there a non-compiled version of WLED/WLED SR for the ESP32? Current controller is an Athom WLED Music RGB Strip Controller. I also have ESP32, Node32s development boards available.

I have Python code that interfaces Athom controller using the HTTP Api; would like to use Gestures to to set variables in the Python code. Currently variables are FX and FP and time.sleep(seconds).

Python code for WLED effects

Regards,
William

Question Tags: APDS9960, ESP32, WLED
8 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 1 month ago

Hi.
 
I’m sorry for taking so long to get back to you.
Unfortunately, I never experimented with that module. Have you taken a look at the adafruit library? Usually, their libraries are compatible with the ESP32 and you only need to adjust the I2C pins in the code. 
https://github.com/adafruit/Adafruit_APDS9960/blob/master/examples/gesture_sensor/gesture_sensor.ino
 
Regards,
Sara
 

0 Vote Up Vote Down
William Lucid answered 4 weeks ago

Hi Sara,
My apologies for the delayed response.
My finding on the APDS9960 Gesture sensore; not suited for the application of creating 0-255 values needed for WLED URL variables.  Thinking of using a “paddle” with the MPU6050 mounted, then a person could “wave” the “paddle” generating RGB values in the range 0-255.  I have coded a sketch to try “different” methods of declaring the red, green, and blue variables.  Sketch collects 40 passed of gathering data; then FTP becomes available for reading the data collected.
Testing_MPU6050.ino
Declarations of red, green, and blue:

  /* Get new sensor events with the readings */
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
int red = map((a.acceleration.x), -32768, 32767, 0, 255);
int green = map((a.acceleration.y), -32768, 32767, 0, 255);
int blue = map((a.acceleration.z), -32768, 32767, 0, 255);

Need to experiment to get the most 0-255 values I can “pull” out of the RGB declarations.  Any suggestions; I am seeing limited range and not the full 0-255 range.  I would like to elimanate any negative values.
 
Google Sheet of data logged
 
Regards,
William

0 Vote Up Vote Down
William Lucid answered 3 weeks ago

Good Evening,
Created a sketch that creates variables: “effects,” “intensity,” and “color pallete” for use with WLED.  More details about the WLED can be found at:  WLED Project
Here are the results of MPU6050 Accelerometer and Gyro Breakout project:
Resultsfrom MPU6050_WLED sketch
MPU6050_WLED project can be found at:  WLED Project
Short video of WLED receiving commands from Python linked in this topic:  WLED Strip LED light effects
Best of all WLED is a compiled binary, it can be installed to ESP32 from a Web base installer or you can compile a customized version.
Regards,
William

0 Vote Up Vote Down
Sara Santos Staff answered 3 weeks ago

Thanks for the update.
Looking forward to seeing the final project.
Regards,
Sara

0 Vote Up Vote Down
William Lucid answered 2 weeks ago

Good Evening,

Short video

Short video; waving “paddle” with ESP32 and MPU6050 Accelrometer/Gyroscope, effecting changes to RGB Leds being controlled by a Athom ESP32 Music controller for addressable RGB Leds.  Athom device is running WLED Sound Reactive firmware; which has WiFi and responds to a “custom” URL sent from the ESP32 on the “paddle.”.

There is a lag between paddle movement and seeing a change in effect, intensity, and color.  Maybe due to math processes running before the URL is sent.

MPU6050_WLED Github Repository

Regards,
William

0 Vote Up Vote Down
Sara Santos Staff answered 2 weeks ago

Wow.
Thanks for sharing the video. It is looking great!
Keep up the good work 😀

0 Vote Up Vote Down
William Lucid answered 2 weeks ago

Good Morning Sara,

Thank you; your feedback is apreciated.

“MPU6050_WLED.ino” sketch sends a “custom” URL from 2nd ESP32 to the controller; which runs the WLED Sound Reactive firmware.  Parameters FX (effects), intensity (IX), and colors (FP) are “generated” by motion of the MPU6050; if there is no MPU6050 motion,  FX, and FP are “generated” randomly. Sketch uses interrupt on the MPU6050; to know when motion is detected.

Regards,
William

0 Vote Up Vote Down
William Lucid answered 1 week ago

Good Morning,

Struggling to figure out a way to keep motion detection active, for sequential data readings; decide on another approach.  Using a touch pin with a conditional statement.  I have the desired result working.

If the “Chromawand” is in use the motion function is called; when not in use, noMotion function is called. Nearly perfect; except for some math processing time I think, as there is some lag between “Chromawand” movement andd seeing the change in RGB effects.

Code is on GitHUb

William

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2023 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.