Variable, names, char string trouble

Hi

I'm learning arduino coding and today I met this problem for my hiveMonitor.

I need to send a unique ID from my LoRa sender to my LoRa receiver.

FYI: Until I tried to add a unique name my prototype was running perfect.

This is the plan:

Sender need to send a unique ID (a name) hiveName = "Hive-1" to receiver.

On sender side I need to concatenate a few values and name in a LoRaMessage , for this I plan to use:

String LoRaMessage = String(packetID) + "/" + String(weight) +  "\" + String(hiveName);

So my problem is, in sender code:
How do I declare the variable and also declare it to be used in my LoRaMessage String operation?

I have tried these to variants with no luck...

char hiveName[] = "Hive-1";
and
String hiveName = String("Hive-1");

but when I compile I get this:

Your code misses ; after delay(5000)

Where did you declare LoRaMessage? This string is outside the {} not known.

1 Like

could you post both your code and errors using the </> rather images

copy the code/errror and in the response, click the </> icon and paste in the highlighted area

It worked, detalis grrr.... thanks!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.