CDC.read

From Pinguino-Wiki
Jump to: navigation, search

Contents

Name

CDC.read - read string from CDC device.

Description

This command receives a string from the CDC device - usually USB connected to virtual text terminal.

The Communication Device Class (CDC) is a general-purpose way to enable all types of communications on the Universal Serial Bus (USB). This class makes it possible to connect communication devices such as digital telephones or analog modems, as well as networking devices like Asymmetric Digital Subscriber Line (ADSL, DSL) or Cable modems. While a CDC device enables the implementation of quite complex devices, it can also be used as a very simple method for communication on the USB. For example, a CDC device can appear as a virtual COM port (terminal window), which greatly simplifies application development on the host side.

Since Beta 9.5

Syntax

  u8 len = CDC.read(Array)

Example

  u8 array[64];
  void loop()
  {
     u8 len = CDC.read(array);
     if(len > 0)
        CDC.print(array,len);
  }

Bugs

See also

Printf for all supported formats.
Sprintf

CDC.getString        CDC.print        CDC.printf
CDC.println          CDC.read         CDC.write
CDC.getKey

Serial.getString     Serial.print     Serial.printf
Serial.println       Serial.read      Serial.write

lcd.print

Comments

Personal tools