Hi there!
Firstly I’d just like to thank you for all your help towards us fellow makers/tinkerers!
so, I have followed this tutorial: Overview | Wireless NeoPixel Controller | Adafruit Learning System to create a remote controller for neopixels,
My aim is to apply this controller to trigger various fire effects replacing some of the pre-set effects already in the reciever code such as rainbow fade ( which I am currently trying to replace with fire2012 FastLED/Fire2012.ino at master · FastLED/FastLED · GitHub)
I have managed ( with some help) to achieve this, however it only works on the first LED on a strip of 60, if any one can please help me with some advice as to overcome this problem it would be hugely appreciated my code is as follows :
#include <FastLED.h>
#define FRAMES_PER_SECOND 30 // %%%%%%%%%%%%%%%%%% best guess for this
#define LED_PIN 12
#define NUM_LEDS 144
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define COOLING 55
#define SPARKING 120
CRGBArray<NUM_LEDS> leds;
#include <SPI.h>
#include <RH_RF69.h>
#include <Wire.h>
#define LED 13
/********** NeoPixel Setup *************/
#define UPDATES_PER_SECOND 100
CRGBPalette16 currentPalette( CRGB::Black);
CRGBPalette16 targetPalette( PartyColors_p );
TBlendType currentBlending;
int SPEEDO = 25;
int STEPS = 20;
int HUE = 200; // starting color
int SATURATION = 255;
int BRIGHTNESS = 200;
int glitter = 0;
/************ Radio Setup ***************/
// Change to 434.0 or other frequency, must match RX's freq!
#define RF69_FREQ 915.0
#if defined (__AVR_ATmega32U4__) // Feather 32u4 w/Radio
#define RFM69_CS 8
#define RFM69_INT 7
#define RFM69_RST 4
#endif
#if defined(ARDUINO_SAMD_FEATHER_M0) // Feather M0 w/Radio
#define RFM69_CS 8
#define RFM69_INT 3
#define RFM69_RST 4
#endif
#if defined (__AVR_ATmega328P__) // Feather 328P w/wing
#define RFM69_INT 3 //
#define RFM69_CS 4 //
#define RFM69_RST 2 // "A"
#endif
#if defined(ESP32) // ESP32 feather w/wing
#define RFM69_RST 13 // same as LED
#define RFM69_CS 33 // "B"
#define RFM69_INT 27 // "A"
#endif
// Singleton instance of the radio driver
RH_RF69 rf69(RFM69_CS, RFM69_INT);
bool oldState = HIGH;
void setup()
{
delay( 3000 ); // power-up safety delay
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS );
pinMode(LED, OUTPUT);
pinMode(RFM69_RST, OUTPUT);
digitalWrite(RFM69_RST, LOW);
Serial.println("Feather RFM69 RX/TX Test!");
// manual reset
digitalWrite(RFM69_RST, HIGH);
delay(10);
digitalWrite(RFM69_RST, LOW);
delay(10);
if (!rf69.init())
{
Serial.println("RFM69 radio init failed");
while (1);
}
Serial.println("RFM69 radio init OK!");
// Defaults after init are 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM (for low power module)
// No encryption
if (!rf69.setFrequency(RF69_FREQ))
{
Serial.println("setFrequency failed");
}
// If you are using a high power RF69 eg RFM69HW, you *must* set a Tx power with the
// ishighpowermodule flag set like this:
rf69.setTxPower(14, true);
// The encryption key has to be the same as the one in the server
uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
};
rf69.setEncryptionKey(key);
pinMode(LED, OUTPUT);
Serial.print("RFM69 radio @"); Serial.print((int)RF69_FREQ); Serial.println(" MHz");
delay(500);
Gradient(); //So the lights come un upon startup, even if the trigger box is off
}