[SOLVED] Neopixel with Arduino Nano via HC-05 Bluetooth Adapter and Blynk

Hello!
I’m trying to implement Blynk into my NeoPixel Project, but no Pixel lights up… I’m sure they’re working. Are there probaply compatibility issues?
I tried the code but instead of the neopixel i set an digital output to high, which worked.

    //BLINK SETUP
    #define BLYNK_USE_DIRECT_CONNECT
    #include <SoftwareSerial.h>
    SoftwareSerial DebugSerial(0, 1); // RX, TX
    #define BLYNK_PRINT DebugSerial
    #include <BlynkSimpleSerialBLE.h>
    char auth[] = "9****2";

    //NEOPIXEL SETUP
    #include <Adafruit_NeoPixel.h>
    #ifdef __AVR__
    #include <avr/power.h>
    #endif
    #define PIN 6
    Adafruit_NeoPixel strip = Adafruit_NeoPixel(24, PIN, NEO_GRB + NEO_KHZ800);

    void setup()
    {
      DebugSerial.begin(9600);
      Serial.begin(9600);
      Blynk.begin(Serial, auth);
      strip.begin();
      strip.show();
      strip.setPixelColor(1, (strip.Color(0, 255, 255)));
      strip.show();
      delay(500);
      strip.setPixelColor(1, (strip.Color(0, 0, 0)));
      strip.show();
    }

    void loop()
    {
      Blynk.run();
    }

    BLYNK_WRITE(V3)
    {
      int pindata = param.asInt();
      if(pindata==1)
      {
        strip.setPixelColor(1, (strip.Color(0, 255, 255)));
        strip.show();
      }
      else
      {
        strip.setPixelColor(1, (strip.Color(0, 0, 0)));
        strip.show();
      }
    }

You are trying to use SoftwareSerial over default Hardware UART pins for your debug (while also trying to link to the HC-05 module over same pins)… Don’t :wink:

Change the debug pins!

1 Like

Thank you for your answer!
I changed it to

SoftwareSerial DebugSerial(2, 3); // RX, TX

I changed the code at this part for testing as well

BLYNK_WRITE(V3)
{
int pindata = param.asInt();
if(pindata==1)
{
strip.setPixelColor(1, (strip.Color(0, 255, 255)));
strip.show();
digitalWrite(5, HIGH);
}
else
{
strip.setPixelColor(1, (strip.Color(0, 0, 0)));
strip.show();
digitalWrite(5, LOW);
}
}

The LED on pin 5 turns on and off when I push the button in the Blynk app. The Neopixels still don’t light up. :confused:


edit:
Oh, I forgot setting the pinMode :see_no_evil:

1 Like