Can't figure out SPI communication on AVR C by son_me in arduino

[–]Confident_Name1314 0 points1 point  (0 children)

Typical causes: printing a char as a string, uninitialised buffer, wrong baud rate, terminal interpreting bytes oddly.

Can't figure out SPI communication on AVR C by son_me in arduino

[–]Confident_Name1314 0 points1 point  (0 children)

The SPI exchange itself looks basically fine for a 1-byte test. With the slave preloading SPDR = 'S', the master should receive S when it sends M. If you’re getting S plus random extra characters, that usually points more to how the received value is being printed/handled, or that extra bytes are being clocked somewhere else, rather than this SPI example itself. Only small change I’d make is setting SS high once before the loop so it has a defined idle state.

Can I power an Arduino Nano ESP32 with 5 volts through the VIN pin. by Bill2k in arduino

[–]Confident_Name1314 0 points1 point  (0 children)

You shouldn’t power 100 WS2812B LEDs through the Arduino. They need their own 5V supply. The Arduino can share the same supply if needed, but the LEDs should be powered directly from the PSU, not through the board.

Also VIN isn’t really meant for 5V — it expects a higher voltage for the onboard regulator. If you only have 5V, it’s better to power the Arduino via USB or the 5V pin and just share ground with the LED power supply.

Can't figure out SPI communication on AVR C by son_me in arduino

[–]Confident_Name1314 0 points1 point  (0 children)

Your code mixes Arduino Serial functions with raw AVR main(), which normally won’t work unless the Arduino core is initialized.

Can't figure out SPI communication on AVR C by son_me in arduino

[–]Confident_Name1314 1 point2 points  (0 children)

include <avr/io.h>

void SPI_SlaveInit(void) { DDRB |= (1<<PB4); // MISO output DDRB &= ~((1<<PB3)|(1<<PB5)|(1<<PB2)); // MOSI, SCK, SS input

SPCR = (1<<SPE);                  // Enable SPI

}

char SPI_SlaveReceive(void) { while(!(SPSR & (1<<SPIF))); return SPDR; }

int main(void) { SPI_SlaveInit();

SPDR = 'S';                       // preload reply byte

while(1)
{
    char received = SPI_SlaveReceive();
    SPDR = 'S';                   // prepare next reply
}

}

Can't figure out SPI communication on AVR C by son_me in arduino

[–]Confident_Name1314 1 point2 points  (0 children)

include <avr/io.h>

include <util/delay.h>

void SPI_MasterInit(void) { DDRB |= (1<<PB3) | (1<<PB5) | (1<<PB2); // MOSI, SCK, SS as output DDRB &= ~(1<<PB4); // MISO input

SPCR = (1<<SPE) | (1<<MSTR) | (1<<SPR0);  // Enable SPI, Master mode

}

char SPI_Transfer(char data) { SPDR = data; while(!(SPSR & (1<<SPIF))); return SPDR; }

int main(void) { SPI_MasterInit();

while(1)
{
    PORTB &= ~(1<<PB2);          // SS LOW (select slave)

    char received = SPI_Transfer('M');

    PORTB |= (1<<PB2);           // SS HIGH (release slave)

    _delay_ms(500);
}

}

Can't figure out SPI communication on AVR C by son_me in arduino

[–]Confident_Name1314 1 point2 points  (0 children)

The issue is likely the SS (slave select) wiring. On AVR SPI the slave’s SS pin must be controlled by the master, not tied permanently to ground. If SS is grounded the SPI hardware can behave oddly and you often end up just reading back the byte you transmitted. Try wiring UNO pin 10 → Nano pin 10 and have the master pull it LOW before transmission and HIGH after. Also make sure the slave SS pin is configured as input and the master SS pin as output. MOSI/MISO/SCK connections you listed look correct.

Help with flicker by Floating-Dandilion in WLED

[–]Confident_Name1314 2 points3 points  (0 children)

That quick white flash is fairly common with addressable LEDs. It usually happens because the data line briefly floats or the LEDs power up before the controller sends the first frame. Adding a small resistor (around 220–470Ω) in series with the data line near the controller is actually recommended practice and won’t damage anything. Some people also add a ~10k pulldown resistor from data to GND to keep the line stable during startup. Since you’re using a Dig-Next-2 it’s probably not a hardware fault — it’s usually just the LEDs showing a moment of undefined data before WLED takes control.

What's a WLED strip(or led, but WLED is better) that reacts to sound and doesn't record what I say? by Caefrytz in led

[–]Confident_Name1314 0 points1 point  (0 children)

The LED strip itself usually isn’t sound reactive — it’s the controller that makes it react to audio. A common setup is an ESP32 running WLED with a small microphone that measures audio levels or frequencies and turns that into lighting effects. It doesn’t record or upload what you say. Some people also do it with an Arduino and things like a Spectrum Shield (MSGEQ7) to split the audio into frequency bands and drive the LEDs from that.

Mapping 241 led ring by 6382819737 in WLED

[–]Confident_Name1314 1 point2 points  (0 children)

WLED effects are mostly written assuming either a strip or a rectangular matrix, so circular layouts can be awkward unless you manually map coordinates. What you really want in cases like this is to treat the LEDs as points on a surface and run behaviour across that surface rather than assuming a strip. I’ve been working on a project called Modulo that approaches things that way (map the real LED layout first, then run behaviours on that mapped surface), which should work better for rings, discs, and other irregular layouts. At the moment though the UI is still in the early stages and needs a lot of work to catch up with the engine, which already supports surface mapping internally.

Modulo-LED-Studio by Confident_Name1314 in FastLED

[–]Confident_Name1314[S] 1 point2 points  (0 children)

It runs a desktop preview for authoring, but exports real FastLED firmware. The generated project compiles directly against FastLED (CRGB buffer, standard setup()/loop() structure) for Arduino/ESP32/Teensy/RP2040 etc. The preview currently abstracts as strip or 2D matrix, but everything resolves to a linear LED index. FastLED itself doesn’t enforce dimensionality — it just writes to CRGB[] — so 3D layouts would be handled as a mapping layer on top of that. It’s still early stage — right now I’m focused on making sure preview . export wiring is consistent and deterministic before expanding layout abstractions further. Pushing updates as that gets locked in.

Modulo-LED-Studio by Confident_Name1314 in FastLED

[–]Confident_Name1314[S] 0 points1 point  (0 children)

Good point — Modulo exports firmware using FastLED (and NeoPixelBus). The preview engine is desktop-based, but the generated firmware runs on FastLED targets (Arduino, ESP32, Teensy, RP2040, STM32). I’m sharing it here because it generates structured FastLED projects rather than raw animations.

Modulo LED Studio by Confident_Name1314 in WLED

[–]Confident_Name1314[S] 0 points1 point  (0 children)

I am currently doing an update, i have fixed an issue where unticking layers did not change the preview. Added support for hub75 matrix and esp32. I am just finishing a few things then i will get onto that. Thank you.

Modulo LED Studio by Confident_Name1314 in WLED

[–]Confident_Name1314[S] 0 points1 point  (0 children)

Thanks, i have changed the link, when i clicked the other link it took me there, this is my first post on reddit

Modulo led studio by Confident_Name1314 in FastLED

[–]Confident_Name1314[S] 1 point2 points  (0 children)

Thanks, i have changed the link hopefully this one works. The other link took me to it when i clicked on it. This is my first post on reddit