CDC.print

From Pinguino
Revision as of 11:22, 24 March 2011 by Skc (talk | contribs) (Bugs: Use of CONTROL_LINE under Windows)
Jump to: navigation, search

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