Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    hint: with serial.write(b) you get to 256. with two serial.write(b) you get to 256*256 (65536) Commented May 21, 2019 at 13:35
  • 2
    If you want to do this in ASCII (opposing to byte values like Juraj suggested), you should use a message delimiter - a special character that marks the end of a number. You can use the newline character \n for this. Then you can read the digits one by one, adding them together to the big number. For further help, we need to see your code. Commented May 21, 2019 at 13:41
  • Using two serial.write (b) is nice idea, but I can't get many numbers which lies between 0-65536 with that logic. And my code is very basic, I'm just using serial.write () to send and serial. read() to receive.. I don't think if it will help you. Commented May 21, 2019 at 14:33
  • What do you mean "I can't get many numbers which lies between 0-65536 with that logic"? You can send as many ints as you want. You would send each int as a pair of bytes, as shown in CrossRoads' answer. Each unsigned int can hold a value from 0-65535. Commented May 21, 2019 at 16:45
  • i can move up to 32 bytes from one arduino to another using master/slave architecture. if that helps, i can post an answer Commented May 21, 2019 at 17:04