Difference between revisions of "CDC.print"

From Pinguino
Jump to: navigation, search
(Added content)
(Bugs: Use of CONTROL_LINE under Windows)
Line 23: Line 23:
  
 
== Bugs ==
 
== Bugs ==
 +
 +
On windows, the CONTROL_LINE variable must be used.
 +
 +
Instead of: <code>CDC.print("toto",4);</code>
 +
 +
use: <code>if (CONTROL_LINE) CDC.print("toto",4);</code>
 +
 +
<code>CONTROL_LINE</code> is used to know if a terminal is connected to Pinguino.
 +
If it is not used ( only on windows ) the USB buffer on the PC side can be overloaded.
  
 
== See also ==
 
== See also ==

Revision as of 11:22, 24 March 2011

Name

CDC.print - send a string through the USB emulating a serial port

Description

Since Beta 9.5

Syntax

 CDC.print(String,Length);

Example

void setup()
{
}

void loop()
{
CDC.print("TOTO",4); // Send string throug emulated serial port to pc
delay(200);
}

Bugs

On windows, the CONTROL_LINE variable must be used.

Instead of: CDC.print("toto",4);

use: if (CONTROL_LINE) CDC.print("toto",4);

CONTROL_LINE is used to know if a terminal is connected to Pinguino. If it is not used ( only on windows ) the USB buffer on the PC side can be overloaded.

See also

CDC.read

Comments