Insane FPV Bando Light Course

We've got an abandoned building, a f* ton of led strips and lipo batteries and a bunch of amateur film geeks, and racing drone pilots & i want to light up the building for a fit inducing FPV drone race, (and film it all for youtube)... but i'm pretty much a noob to arduino & stuck on some coding.

So, I already have some store brought light controllers for the coloured strips to be used to light the features. But for the gates to fly through, i want to use some white 12v strips linked in a square (approx 1.5m*4) I've been working on a system using a mega to send commands via 433tx to nanos with receivers, and a relay.

To start i was hoping just to work on the ability to power the gates remotely (using a button on the mega), which i managed to get working. however now i've been working on the ability to address the gates individually so i can flash one specifically, or enable certain sections of the track. the problem i'm having is with arranging the data for sending via virtual wire

vw_send((uint8_t *)senddata, strlen(senddata));

so i only need to send a few digits, i want 2 for gate addressing. followed by one to signify power state of the relay... sounds simple but....how the f* do i do this??? I've tried all sorts...

if i modify the data in the loop via something like char senddata = (120); then i can modify what is going to be sent. but that way means having to do a bit of code to change the data to address every gate, instead i want to make an array, in which i can modify either the gate number (first 2 digits)or state (last digit).

Everything i have tried brings up either conversion errors or just outright doesn't work, rather than list my many failed attempts, does anyone know how to go about it. how do i create a viable array for sending, how do i modify each digit(s) (*,) -without overwriting the whole array and how do i send it.

i think the receivers are sorted but tell me if i've been dumb here too

if ((buf[0] == '0') && (buf[1] == '1') && (buf([2] == 1)) so this would be on gate 1, and if it receives 011 it would activate the relay

please help :) i've spent far longer on this than i wish to admit many thanks

gavferry@gmail.com:
if ((buf[0] == ‘0’) && (buf[1] == ‘1’) && (buf([2] == 1))

‘1’ and 1 are not the same thing. ‘1’ is the character 1. Example:

void setup() {
  Serial.begin(9600);
  while(!Serial){}
  byte x=1;
  Serial.println(x);
  byte y='1';
  Serial.println(y);
}

void loop() {}

output:

1
49

cheers for the reply, i missed the quotes when retyping on that last line.

to make life easier i have just loaded the standard receiver code for now, forgetting any checks on the data and just printing whatever is sent, just so i can be sure i'm sending the correct data in the first place...which i'm not... :(

I've tried all sorts though, including moving on to radiohead lib rather than its predecessor virtualwire

the command to send data is //driver.send((uint8_t *) msg, srtlen (msg)); with msg being the data and strlen being the size

how do i create and an accepted string for this?

i want to have 3 useable ints an the array, and be able to change the data in each character individually (group, gate, state)

these then need combining in to a null terminated string, labelled msg (that would be accepted and not bring up errors like can't convert string to char, const char to char and so on)

using const char *msg = "Hello world", and char *msg = "Hello World" seem to be the only way i can get viable data to send, any other formats fails

I've tried creating group,gate & state as ints, arrays, strings, to combine, adressing the indidual digits to modify. i've tried commands like itoa, sprintf and many more that i either did badly or probably would never work anyway.

Can anyone help, i'm losing my mind, it sounds like it should be so simple, everytime i think i've sussed it i get gibberish or nothing on the receiver

thanks G