Hi guys! i’m new to arduino and i’m trying to make my neopixel ring work with blynk. I used the example code fot my BT device, it connects and the app recognizes the bluetooth but the neopixels don’t seem to respond.
I want to use the zeRGBa widget.
i used this code
#define BLYNK_PRINT Serial
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
#include <BlynkSimpleSerialBLE.h>
#include <Adafruit_NeoPixel.h>
char auth[] = "bcbc198b969948b4b39d1a01c97a00f2";
SoftwareSerial SerialBLE(10, 11); // RX, TX
#define PIN A5
Adafruit_NeoPixel strip = Adafruit_NeoPixel(16, PIN, NEO_GRB + NEO_KHZ800);
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
if (WheelPos < 85) {
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
} else if (WheelPos < 170) {
WheelPos -= 85;
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
} else {
WheelPos -= 170;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
}
BLYNK_WRITE(V1)
{
int shift = param.asInt();
for (int i = 0; i < strip.numPixels(); i++)
{
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + shift) & 255));
}
strip.show();
}
void setup()
{
// Debug console
Serial.begin(9600);
SerialBLE.begin(9600);
Blynk.begin(SerialBLE, auth);
Serial.println("Waiting for connections...");
strip.begin();
strip.show();
}
void loop()
{
Blynk.run();
}