Remote neo pixel controller

Hello everyone!

I have followed this tutorial Overview | Wireless NeoPixel Controller | Adafruit Learning System

and have built the control box and wired the reciever, with success in getting it all to run ok.

However I am aiming to apply a variety of fire effects to some of the buttons as opposed to the rainbow effect pre-sets.

the fire effect is from FastLED/Fire2012.ino at master · FastLED/FastLED · GitHub

(which I have altered to create 3-4 variations)

Below is my attempt at inserting one of these fire effects to replace "Rainbow fade"
( original code: Receiver Code | Wireless NeoPixel Controller | Adafruit Learning System )

I have attached my Code

But I am recieving various errors such as:

In file included from C:\Users\Admin\Documents\arduino\Neo_pixel_reciever_fire\Neo_pixel_reciever_fire.ino:11:0:

C:\Users\Admin\Documents\Arduino\libraries\FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.002.006

pragma message "FastLED version 3.002.006"

^

C:\Users\Admin\Documents\arduino\Neo_pixel_reciever_fire\Neo_pixel_reciever_fire.ino: In function 'void ledMode(int)':

Neo_pixel_reciever_fire:289:54: error: 'Fire2012' was not declared in this scope

case 15:SATURATION=255; BRIGHTNESS=200; Fire2012(); // rainbow fade

^

C:\Users\Admin\Documents\arduino\Neo_pixel_reciever_fire\Neo_pixel_reciever_fire.ino: At global scope:

Neo_pixel_reciever_fire:346:5: error: expected unqualified-id before 'for'

for( int i = 0; i < NUM_LEDS; i++) {

^

Neo_pixel_reciever_fire:346:21: error: 'i' does not name a type

for( int i = 0; i < NUM_LEDS; i++) {

^

Neo_pixel_reciever_fire:346:35: error: 'i' does not name a type

for( int i = 0; i < NUM_LEDS; i++) {

^

Neo_pixel_reciever_fire:351:5: error: expected unqualified-id before 'for'

for( int k= NUM_LEDS - 1; k >= 2; k--) {

^

Neo_pixel_reciever_fire:351:31: error: 'k' does not name a type

for( int k= NUM_LEDS - 1; k >= 2; k--) {

^

Neo_pixel_reciever_fire:351:39: error: 'k' does not name a type

for( int k= NUM_LEDS - 1; k >= 2; k--) {

^

Neo_pixel_reciever_fire:356:5: error: expected unqualified-id before 'if'

if( random8() < SPARKING ) {

^

Neo_pixel_reciever_fire:362:5: error: expected unqualified-id before 'for'

for( int j = 0; j < NUM_LEDS; j++) {

^

Neo_pixel_reciever_fire:362:21: error: 'j' does not name a type

for( int j = 0; j < NUM_LEDS; j++) {

^

Neo_pixel_reciever_fire:362:35: error: 'j' does not name a type

for( int j = 0; j < NUM_LEDS; j++) {

^

Multiple libraries were found for "Wire.h"
Used: C:\Users\Admin\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.13\libraries\Wire
Not used: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
exit status 1
'Fire2012' was not declared in this scope

I must admit although i have played with arduino over the years with simple sketch's, I do feel this is a bit out of my comfort zone however it is for a project I am dying to get running, If anyone could please offer me some tips or point me in the right direction as to what parts of the code I need to replace / keep it would be hugely helpfull and appreciated!

Thanks in advance!

Neo_pixel_reciever_fire.ino (11 KB)

void Fire2012();
  #define COOLING  55
  #define SPARKING 120

// Array of temperature readings at each simulation cell
  static byte heat[NUM_LEDS];

  // Step 1.  Cool down every cell a little
    for( int i = 0; i < NUM_LEDS; i++) {
      heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / NUM_LEDS) + 2));
    }

Here you have a semicolon after the function name and you are missing the curly brackets to enclose the Fire2012() function code. Use autoformat (in the IDE, ctrl-t or Tools, Auto Format) to see the problem.

Also, I am not sure about putting #defines inside of a function. You may need to move those #defines outside the function, maybe to the top of the code with the other #defines. It may be OK to put them in a function, I don't know. It is not something that I have seen, though.

Hey groundfungus,

Thanks for the tip, I have tried that but to no avail, no i get the error message :

In file included from C:\Users\Admin\Downloads\Neo_pixel_reciever_fire\Neo_pixel_reciever_fire.ino:11:0:

C:\Users\Admin\Documents\Arduino\libraries\FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.002.006

pragma message "FastLED version 3.002.006"

^

C:\Users\Admin\Downloads\Neo_pixel_reciever_fire\Neo_pixel_reciever_fire.ino: In function 'void ledMode(int)':

Neo_pixel_reciever_fire:262:64: error: 'Solid' was not declared in this scope

case 0: HUE = 0; SATURATION = 255; BRIGHTNESS = 200; Solid(); // red

^

Neo_pixel_reciever_fire:292:63: error: 'Rainbow_Fade' was not declared in this scope

case 15: SATURATION = 255; BRIGHTNESS = 200; Rainbow_Fade(); // rainbow fade

^

Neo_pixel_reciever_fire:294:69: error: 'Rainbow' was not declared in this scope

case 16: STEPS = 4; SATURATION = 255; BRIGHTNESS = 200; Rainbow(); //rainbow 2

^

C:\Users\Admin\Downloads\Neo_pixel_reciever_fire\Neo_pixel_reciever_fire.ino: At global scope:

Neo_pixel_reciever_fire:308:23: error: expected constructor, destructor, or type conversion before ';' token

SetupGradientPalette();

^

Neo_pixel_reciever_fire:311:1: error: 'startIndex' does not name a type

startIndex = startIndex + 1; // motion speed

^

Neo_pixel_reciever_fire:312:26: error: expected constructor, destructor, or type conversion before '(' token

FillLEDsFromPaletteColors( startIndex);

^

Neo_pixel_reciever_fire:313:1: error: 'FastLED' does not name a type

FastLED.show();

^

Neo_pixel_reciever_fire:314:1: error: 'FastLED' does not name a type

FastLED.delay(SPEEDO);

When you make changes to your code, post the new version so we can keep up.

ah yeah sorry about that,

Neo_pixel_reciever_fire2.ino (10.8 KB)

If you post code, please add code tags: (this also can be applied to error messages)

Your code belongs in her...

As to how you can do that, read the following post written by nickgammon:

https://forum.arduino.cc/index.php/topic,148850.0.html

Can you provide a link to where you got the library that contains RH_RF69.h. It seems to be part of the RadioHead library. There are different versions of that library available and I need the one that you are using.

This is where I obtained the radiohead :
library Using the RFM69 Radio | Adafruit Feather M0 Radio with RFM69 Packet Radio | Adafruit Learning System

In regards to using the code tags, it says my post includes too many characters.

You can do something like: (not sure if this works)

First part..
Second part..
#include <FastLED.h>
 
#define LED_PIN  12
#define NUM_LEDS    20    
#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
}
 
  void loop(){
  
   
  
  if (rf69.waitAvailableTimeout(1000)) {
    // Should be a message for us now   
    uint8_t buf[RH_RF69_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);
    
    if (! rf69.recv(buf, &len)) {
      Serial.println("Receive failed");
      return;
    }
    
    //digitalWrite(LED, HIGH);
   
    //rf69.printBuffer("Received: ", buf, len);
    //buf[len] = 0;
    
    //Serial.print("Got: "); Serial.println((char*)buf);
    //Serial.print("RSSI: "); Serial.println(rf69.lastRssi(), DEC);
 
    
    char radiopacket[20] = "Button #";//prep reply message to send
 
    
 
    if (buf[0]=='A'){ //the letter sent from the button
      ledMode(0);
        radiopacket[8] = 'A';   
    }
     else if (buf[0]=='B'){ //the letter sent from the button
      ledMode(1);
      radiopacket[8] = 'B';    
    }
    
     else if (buf[0]=='C'){ //the letter sent from the button
      ledMode(2);
       radiopacket[8] = 'C';    
    }
 
     else if (buf[0]=='D'){ //the letter sent from the button
      ledMode(3);
      radiopacket[8] = 'D';    
    }
         else if (buf[0]=='E'){ //the letter sent from the button
      ledMode(4);
      radiopacket[8] = 'E';    
    }
    
     else if (buf[0]=='F'){ //the letter sent from the button
      ledMode(5);
       radiopacket[8] = 'F';    
    }
 
     else if (buf[0]=='G'){ //the letter sent from the button
      ledMode(6);
      radiopacket[8] = 'G';
          
    } 
     else if (buf[0]=='H'){ //the letter sent from the button
      ledMode(7);
      radiopacket[8] = 'H';    
    }
    
     else if (buf[0]=='I'){ //the letter sent from the button
      ledMode(8);
       radiopacket[8] = 'I';    
    }
 
     else if (buf[0]=='J'){ //the letter sent from the button
      ledMode(9);
      radiopacket[8] = 'J';    
    }     
     else if (buf[0]=='K'){ //the letter sent from the button
      ledMode(10);
      radiopacket[8] = 'K';    
    }
    
     else if (buf[0]=='L'){ //the letter sent from the button
      ledMode(11);
       radiopacket[8] = 'L';    
    }
 
     else if (buf[0]=='M'){ //the letter sent from the button
      ledMode(12);
      radiopacket[8] = 'M';    
    }
     else if (buf[0]=='N'){ //the letter sent from the button
      ledMode(13);
      radiopacket[8] = 'N';    
    }
     else if (buf[0]=='O'){ //the letter sent from the button
      ledMode(14);
      radiopacket[8] = 'O';    
    }
     else if (buf[0]=='P'){ //the letter sent from the button
      ledMode(15);
      radiopacket[8] = 'P';    
    }
         else if (buf[0]=='Q'){ //the letter sent from the button
      ledMode(16);
      radiopacket[8] = 'Q';    
    }
         else if (buf[0]=='R'){ //the letter sent from the button
      ledMode(17);
      radiopacket[8] = 'R';    
    }
             else if (buf[0]=='S'){ //the letter sent from the button
      ledMode(18);
      radiopacket[8] = 'S';    
    }
         else if (buf[0]=='T'){ //the letter sent from the button
      ledMode(19);
      radiopacket[8] = 'T';    
    }
         else if (buf[0]=='Z'){ //the letter sent from the button
      ledMode(20);
      radiopacket[8] = 'Z';    
    }
 
 
  /*   radiopacket[9] = 0;
 
    Serial.print("Sending "); Serial.println(radiopacket);
    rf69.send((uint8_t *)radiopacket, strlen(radiopacket));
    rf69.waitPacketSent();  */
 
    digitalWrite(LED, LOW);
  }
 
}
void ledMode(int i) {
  switch(i){
    case 0: HUE=0; SATURATION=255; BRIGHTNESS=200; Solid();    // red
            break;
    case 1: HUE=40; SATURATION=255; BRIGHTNESS=200; Solid();    // gold
            break;
    case 2: HUE=100; SATURATION=255; BRIGHTNESS=200; Solid();    // green
            break;
    case 3: HUE=140; SATURATION=255; BRIGHTNESS=200; Solid();    // Blue   
            break;
    case 4: HUE=180; SATURATION=255; BRIGHTNESS=200; Solid();    // purple
            break;
    case 5: HUE=220; SATURATION=255; BRIGHTNESS=200; Solid();    // pink
            break;
    case 6: HUE=0; SATURATION=0; BRIGHTNESS=200; Solid();    // white
            break;
    case 7: HUE=0; BRIGHTNESS=0; Solid();    // off
            break;
    case 8: HUE=0; SATURATION=255; BRIGHTNESS=200; Gradient();    // red
            break;
    case 9: HUE=40; SATURATION=255; BRIGHTNESS=200; Gradient();    // gold
            break;
    case 10: HUE=100; SATURATION=255; BRIGHTNESS=200; Gradient();    // green
            break;
    case 11: HUE=140; SATURATION=255; BRIGHTNESS=200; Gradient();    // blue
            break;
    case 12:HUE=180; SATURATION=255; BRIGHTNESS=200; Gradient();    // purple
            break;
    case 13:HUE=220; SATURATION=255; BRIGHTNESS=200; Gradient();    // pink
            break;
    case 14:HUE=160; SATURATION=50; BRIGHTNESS=200; Gradient();    // white
            break;
    case 15:SATURATION=255; BRIGHTNESS=200; Rainbow_Fade();    // rainbow fade
            break;
    case 16:STEPS=4; SATURATION=255; BRIGHTNESS=200; Rainbow();   //rainbow 2
            break;
    case 17:STEPS=20; BRIGHTNESS=200; SATURATION=255; Rainbow();    // rainbow 3
            break;
    case 20:BRIGHTNESS=200;
            break;
            
  }
}
 
// GRADIENT --------------------------------------------------------------
void Gradient()
{
  SetupGradientPalette();
 
  static uint8_t startIndex = 0;
  startIndex = startIndex + 1;  // motion speed
  FillLEDsFromPaletteColors( startIndex);
  FastLED.show();
  FastLED.delay(SPEEDO);
}
 
// SOLID ----------------------------------------------------
void Solid()
{
   fill_solid(leds, NUM_LEDS, CHSV(HUE, SATURATION, BRIGHTNESS)); 
   FastLED.show(); 
   delay(20); 
 
}
 
// RAINBOW --------------------------------------------------
void Rainbow()
{ 
  FastLED.setBrightness(  BRIGHTNESS );
  currentPalette = RainbowColors_p;
  
  static uint8_t startIndex = 0;
  startIndex = startIndex + 1; 
 
  FillLEDsFromPaletteColors( startIndex);
    
  FastLED.show();
  FastLED.delay(SPEEDO);  
}
// RAINBOW FADE --------------------------------------------------
void Rainbow_Fade() {                         //-m2-FADE ALL LEDS THROUGH HSV RAINBOW
    static byte heat[NUM_LEDS];

  // Step 1.  Cool down every cell a little
    for( int i = 0; i < NUM_LEDS; i++) {
      heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / NUM_LEDS) + 2));
    }
  
    // Step 2.  Heat from each cell drifts 'up' and diffuses a little
    for( int k= NUM_LEDS - 1; k >= 2; k--) {
      heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;
    }
    
    // Step 3.  Randomly ignite new 'sparks' of heat near the bottom
    if( random8() < SPARKING ) {
      int y = random8(7);
      heat[y] = qadd8( heat[y], random8(160,255) );
    }

    // Step 4.  Map from heat cells to LED colors
    for( int j = 0; j < NUM_LEDS; j++) {
      CRGB color = HeatColor( heat[j]);
      int pixelnumber;
      if( gReverseDirection ) {
        pixelnumber = (NUM_LEDS-1) - j;
      } else {
        pixelnumber = j;
      }
      leds[pixelnumber] = color;
}
 
 
void SetupGradientPalette()
{
  CRGB light = CHSV( HUE + 25, SATURATION - 20, BRIGHTNESS);
  CRGB dark  = CHSV( HUE, SATURATION - 15, BRIGHTNESS);
  CRGB medium = CHSV ( HUE - 25, SATURATION, BRIGHTNESS);
  
  currentPalette = CRGBPalette16( 
    light,  light,  light,  light,
    medium, medium, medium,  medium,
    dark,  dark,  dark,  dark,
    medium, medium, medium,  medium );
}
 
void FillLEDsFromPaletteColors( uint8_t colorIndex)
{
  uint8_t brightness = BRIGHTNESS;
  
  for( int i = 0; i < NUM_LEDS; i++) {
    leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);
    colorIndex += STEPS;
  }
}

There are a lot of errors in that code. Many missing and/or misplaced curly brackets. Some undeclared and undefined variables.

I do not have a adafruit-feather-m0 so do not want to find and install that core, but I got the code attached to reply #4 to compile for an Uno. The fixes are shown in comments in the code.

Absolutely no guarantee that the code will do what you want, but it does compile with a bunch of warnings.

forum_neopixel.ino (11.5 KB)

Ah! Thank you groundfungus, it is working, but only on the fist LED, I am using a Strip of 60.
Any idea what to change to fix this? thank you again for taking the time to help me!

So I have made plenty of progress. the tx and rx successfully communicate 3 different fire effects however the problem now is that the speed of the fire effect (animations) is very slow and not achieving the desired effect, does any one have an idea why?

#include <FastLED.h>
#include <SPI.h>
#include <RH_RF69.h>
#include <Wire.h>

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

#define STRIP_PIN 12
#define LED 13//left from v1
#define NUM_LEDS 8 
#define LED_TYPE WS2812B //this might need to be doubl checked


#define LED_PIN 12 //this is onboard 

//  The overall fire brightness
//  (this can affect both color levels and power consumption)
int brightness = 200; //128

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, STRIP_PIN, NEO_GRB + NEO_KHZ800);





/************ Radio Setup ***************/
 
// Change to 434.0 or other frequency, must match RX's freq!
#define RF69_FREQ 915.0 //The radio frequency will always be this

 /*This is the one being used I think*/
#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()
{

  //This is the led stuff
  strip.begin();
  strip.setBrightness(brightness);
  strip.show(); // Initialize all pixels to 'off'
  ////////////////////////////////////////////////////

  pinMode(LED, OUTPUT); //reciever v1 


/////////////////////////////////////////////////////////////////radio
 pinMode(RFM69_RST, OUTPUT);  //Think this is the arial 
  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);
}

void loop() 
{

if (rf69.waitAvailableTimeout(1000)) {
    // Should be a message for us now  
    uint8_t buf[RH_RF69_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);
   
    if (! rf69.recv(buf, &len)) {
      Serial.println("Receive failed");
      return;
    }
   
    //digitalWrite(LED, HIGH);
   
    //rf69.printBuffer("Received: ", buf, len);
    //buf[len] = 0;
   
    //Serial.print("Got: "); Serial.println((char*)buf);
    //Serial.print("RSSI: "); Serial.println(rf69.lastRssi(), DEC);
 
   
    char radiopacket[20] = "Button #";//prep reply message to send
 
   
 /*This whole block is just sending back to the reciever what mode is currently on
 AND CHANGING THE LED MODE*/

  switch(buf[0])
  {
    case 'A': FireFX (226, 121,0 );
              radiopacket[8] = 'A';    
            break;
    case 'B': FireFX (150,100 ,0 );    // fx2
              radiopacket[8] = 'B';   
            break;
    case 'C': FireFX (100,40 ,0 );    // fx2
              radiopacket[8] = 'C';  
            break;
    case 'D': FireFX (0,0 ,0 );    // hhmmm off
              radiopacket[8] = 'D';  
            break;
   }
   
  digitalWrite(LED, LOW);
  }
}



//Function to dterine mode
void FireFX (int r, int g, int b) 
{

//  Flicker, based on our initial RGB values
  for(int i=0; i<strip.numPixels(); i++) {
    int flicker = random(0,130); // int flicker = random(0,60);
    int r1 = r-flicker;
    int g1 = g-flicker;
    int b1 = b-flicker;
    if(g1<0) g1=0;
    if(r1<0) r1=0;
    if(b1<0) b1=0;
    strip.setPixelColor(i,r1,g1, b1);
  }
  strip.show();

  //  Adjust the delay here, if you'd like.  Right now, it randomizes the 
  //  color switch delay to give a sense of realism
  delay(random(10,10)); // delay(random(10,113))
}

I have attached TX code as the forum wont allow me to post more than once every 5 minutes and the code is too long for the post, I really just dont get why the fire effect is not running at its correct speed.
Any ideas?

transmitter_v11.ino (11.5 KB)

// Singleton instance of the radio driver
RH_RF69 rf69(RFM69_CS, RFM69_INT);

That is a single instance. A singleton is something completely different.

/*This whole block is just sending back to the reciever what mode is currently on
 AND CHANGING THE LED MODE*/

There is NOTHING in that block that sends anything to the receiver (that should be transmitter).

   int r1 = r-flicker;
    int g1 = g-flicker;
    int b1 = b-flicker;
    if(g1<0) g1=0;
    if(r1<0) r1=0;
    if(b1<0) b1=0;
    strip.setPixelColor(i,r1,g1, b1);

What is the valid range of values for the color components that setPixelColor() accepts?

 delay(random(10,10));

Stick your head in the sand for some random amount of time between 10 milliseconds and 9 milliseconds.

You clearly haven't a clue what random() does with the input arguments. You need to get one.

The code you posted is like the sound of one hand clapping, when you want to know why the clapping sounds so strange.

and the code is too long for the post

It wouldn't be, if you removed all the commented out crap.

void loop() {


  char radiopacket[20];

            if (x==0){ //button 1 sends button A command
              radiopacket[0] = 'A';

          rf69.send((uint8_t *)radiopacket, strlen(radiopacket));

radiopacket is NOT a string, so passing it to a function that expects a string is WRONG. You haven't a clue how much data you actually sent.

You are using (features of) a library that tries (too) damned hard to force asynchronous communication into a synchronous pattern.

Can you imagine your favorite radio station only transmitting a new packet when your radio (and 50 million other radios all) acknowledged the last packet sent?

Does it REALLY matter if a packet get lost?

     delay(100); //the NeoTrellis has a resolution of around 60hz

So?

Your code is littered with delay()s and other blocking code. Of course it is going to be slow.