Language \ Environment \ Comparison
 
Index
 
  The Processing 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: reas at groupc.net
Name  

beginSerial()

   
Examples  
int val; 
void setup() { 
  beginSerial();  // Default start serial at 9600 baud 
} 
void loop() { 
  background(val); 
} 
void serialEvent() { 
  val = serial; 
} 


int val; 
void setup() { 
  beginSerial(115200);  // Start serial at 115200 baud 
} 
void loop() { 
  background(val); 
} 
void serialEvent() { 
  val = serial; 
} 

Description   Update test 2. The Processing serial library allows for easily reading and writing data to external machines. The serial port is a nine pin I/O port that exists on most PCs and can be emulated through USB on Macintosh with the Keyspan USB Serial Adaptor. The first step is to select which serial port your device is physically attached to. Access the menu through: Sketch > Serial Port to make a selection. The beginSerial() method must be placed in the setup() method. The similar beginSerial(rate) method enables changing the data rate from the default 9600.
   
Syntax  
beginSerial()
beginSerial(rate)
   
Parameters  
rate   integer value

   
Returns   None
   
Usage   Application
   
Related   endSerial()
serialWrite()
serialEvent()
serial
   
© 2004 - 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea
Processing is an open project initiated by Ben Fry and Casey Reas