Sketch:
- import processing.serial.*;
- Serial myPort;
- byte arr[] = {0,1,2,3,4,5,6,7,8,9};
- void setup()
- {
- size(400, 600);
- myPort = new Serial(this, "/dev/tty.HC-05-DevB", 57600);
- while (true)
- {
- println("SA " + millis());
- myPort.write(arr);
- println("EA " + millis());
- println("SB " + millis());
- myPort.write((byte)1);
- println("EB " + millis());
- }
- }
- void draw()
- {
- }
Result:
- SA 3314
- EA 3314
- SB 3315
- EB 3324
- SA 3324
- EA 3453
- SB 3453
- EB 3703
- SA 3703
- EA 3953
- SB 3953
- EB 4203
- SA 4203
- EA 4453
- SB 4453
- EB 4703
- SA 4703
- EA 4953
- SB 4953
- EB 5203
- SA 5203
- EA 5453
- SB 5453
How the hell can be sending 10bytes faster than sending a single one?