资 源 简 介
This project includes Arduino libraries to perform buffered, interrupt driven, serial communication with a host application (Processing example included). This provides significant benefit over the good-old Serial.println("some ascii") method both as it has more efficient storage of numerical data as integers, longs, bytes or floats rather than ascii coded strings, as well as being interrupt driven so that it doesn"t block the operation of the device.
Arduino Examples
Serial Echoing
```cpp
include
include
BufferedSerial serial = BufferedSerial(256, 256);
ByteBuffer send_buffer;
void setup()
{
// initialize the serial communication:
serial.init(0, 9600);
serial.setPacketHandler(handlePacket);
// Initialize the send buffer that we will use to send data
send_buffer.init(30);
}
void loop() {
serial.update();
}
void handlePacket(ByteBuffer* p