Name

write()

Class

Serial

Description

Writes bytes, chars, ints, bytes[], Strings to the serial port

Examples

  • // Example by Tom Igoe
    
    import processing.serial.*;
    
    // The serial port:
    Serial myPort;
    
    // List all the available serial ports:
    printArray(Serial.list());
    
    // Open the port you are using at the rate you want:
    myPort = new Serial(this, Serial.list()[0], 9600);
    
    // Send a capital "A" out the serial port
    myPort.write(65);
    
    

Syntax

  • serial.write(src)

Parameters

  • serial(Serial) any variable of type Serial
  • src(byte[], int, String)data to write
  • src(int, String)data to write
  • src(String, int)data to write

Return

  • void