get 2 number on 4...

Hi everybody,

I don’t know how to name my post…

I need some help on my project.

I send in LoRa a variable of 4 number without problem. But after I don’t know how to do…

The number is (for example) “1234”, on my receiver in got 1234 (until now nothing abnormal :stuck_out_tongue_closed_eyes: ), but after…

I want on my receiver separate my number in 2 number.

For example, if I receive 1234, I want to get one variable that is worth 12 and an other that is worse 34, and I don’t know if it’s possible or not…

Thanks for your answer and your help ! :wink:

Integers have no fractions.

division
1234 / 100 = 12

remainder
1234 % 100 = 34

Me, I would read the digits 1 at a time and make 2 numbers, never get 1234 only get 12 and 34.

You seem to have posted a picture of your program rather than the text of the program code. Please post the program as text so we can view it in a text editor.

If you are receiving the "1234" as 4 text characters then you can separate them into two groups like this

char receivedChars[] = "1234";
char myFirstPart[3];
myFirstPart[0] = receivedChars[0];
myFirstPart[1] = receivedChars[1];
myFirstPart[2] = 0; // null terminating character

char mySecondPart[3];
// I'm sure you can figure out the rest

...R

Robin2:
You seem to have posted a picture of your program rather than the text of the program code. Please post the program as text so we can view it in a text editor.

If you are receiving the "1234" as 4 text characters then you can separate them into two groups like this

char receivedChars[] = "1234";

char myFirstPart[3];
myFirstPart[0] = receivedChars[0];
myFirstPart[1] = receivedChars[1];
myFirstPart[2] = 0; // null terminating character

char mySecondPart[3];
// I'm sure you can figure out the

...R
[/quote][quote author=Robin2 link=msg=4048008 date=1549454346]
You seem to have posted a picture of your program rather than the text of the program code. Please post the program as text so we can view it in a text editor.

If you are receiving the "1234" as 4 text characters then you can separate them into two groups like this

[code]char receivedChars = "1234";
char myFirstPart[3];
myFirstPart[0] = receivedChars[0];
myFirstPart[1] = receivedChars[1];
myFirstPart[2] = 0; // null terminating character

char mySecondPart[3];
// I'm sure you can figure out the rest




...R

Thanks for your answer !

I will test your solution.

I notice for the programme code. Next time I will publish him in text.

Thanks