0

I would like to create a ModBus-like communication between Arduinos (WITHOUT any RS232/RS485 module). But the Serial.print(data); convert data to ASCII Human Readable data. I would like to keep the "Byte" format between arduinos.

Does someone know how to remove this conversion? Is it a simple parameter to change or do I have to create a library?

NOTE: I would like to use a modbus because I have 3 or more arduinos to control.

NOTE: I do not use I2C because I have to control I2C servos on a third Arduino.

Thanks.

dsolimano
  • 8,870
  • 3
  • 48
  • 63
Alexis Paques
  • 1,885
  • 15
  • 29

1 Answers1

2

The print function is used to send data in an ASCII encoding; if you want to send the bytes use the write function:

http://arduino.cc/en/Serial/write

e.g.

char mybuffer[] = {2, 4, 8, 3, 6};
Serial.write(mybuffer, 5);
frarugi87
  • 2,826
  • 1
  • 20
  • 41