Synchronized lighting for VESC

Yeah, the walls and interface plates (board to enclosure) are 3D printed. There is a CNC’d aluminum base plate and CNC’d acrylic covers.

@ju_mpe_r

changing the led direction of travel…

color_shifting.cpp #include “color_shifting.h” #include “led_strip_apa102.h” #include “color_palletes.h”

extern “C” { #include “vesc_uart.h” };

void update_strip_colors(void) { uint32_t current_tacho_value; uint32_t pallete_travel; current_tacho_value = bldc_get_tachometer_value(); pallete_travel = current_tacho_value / WHEEL_SIZE_RATIO; for (uint8_t i; i < LED_COUNT; i++) { led_strip_colors[i] = get_pallete_color(pallete_travel + i); } update_strip(); }

Just change led_strip_colors[i] = get_pallete_color(pallete_travel + i); to led_strip_colors[i] = get_pallete_color(pallete_travel - i); ?

yeah, this is fastest solution :wink: but I’m trying to implement this setting based on condition right now…:sweat_smile:

Awesome!

I’m loving the lights man! And making/customizing the palletes is great!

Thanks man! And big thanks for the video! :pray:

p.s. What is your WHEEL_SIZE_RATIO value on the video?

const uint8_t WHEEL_SIZE_RATIO = 10;

I kinda want the lights to blink fast, just like the po-po.

my modified police pallete:

/* POLICE PALLETE */ const hsv_color police_pallete[460] PROGMEM = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,

};

also, resorted to a hardware solution to turn the lights on and off.

https://www.amazon.com/gp/product/B012W6RJ5I/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

2 Likes

:smiley: After that answer everything is fine :wink:

p.s. Thanks for sharing your pallete, I’ll add it to project :wink:

2 Likes

I wonder if this can be ported to the photon remote…it already supports ws2812… @ju_mpe_r @Wajdi what do you think?

@ju_mpe_r I think some options could be added to standby, something like this

6 Likes

Very cool, I like the idea of synchronizing light to movement by distance. I will work on adding that to the list of effects.

1 Like

Yeah! I like this idea and it’s not hard to implement, but don’t know when I will have time for that.

2 Likes

I don’t like that the idea will be used in not open source project. But I understand that can’t do anything with this. So…

2 Likes

Maybe someone has a clue why changes I make that’s not in the main.ino file(like led_count) doesn’t work?

nvm got it to work. Another question - I can’t seem to make it work with @Ackmaniac 's 2.54 version only the new one. Any idea? I set the baud rate to 115200 on both versions.

I can’t get it to work for some reason, seems like the arduino doesn’t read the UART signals from vesc at all

Did you change vesc to ppm and uart?

Yea I checked everything, bluetooth works fine aswell

BT? Might not work with BT.

@ju_mpe_r?

Oh no. I plugged in bt just to make sure the vesc send UART signal, I tried it without the BT

Does not work with Ack 2.54, does work with 3.102 though.

Also, would this work for SK9822? I can’t find apa102s on amazon that are waterproof and have black pcbs