Thomas
Thomas

Reputation: 1565

Arduino: Application communication over built in USB?

The Arduino Nano (and other models) has a USB Connector on the pcb.

Can a Arduino Application (Code inside the loop() Function) communicate to a PC/Mac over the built in USB Channel?

Upvotes: 8

Views: 8266

Answers (2)

Clifford
Clifford

Reputation: 93476

The board at the link you posted uses an FTDI USB to UART chip; the ATMega168 itself has no USB controller. The UART side of the FTDI chip is attached to the ATMega168's RXD/TXD UART pins. So from the point of view of the Arduino code, you are just communicating with a UART driven serial port.

From the PC end, the FTDI chip uses the USBSER.SYS driver to emulate a legacy UART serial port (A Virtual COM Port or VCP). You will be able to see this and which COM port it has been assigned to in Device Manager.

So in essence all you need to know is how to do serial port programming on both the PC and the Arduino and you are good to go.

Upvotes: 4

user529758
user529758

Reputation:

This is how I have done it. You also need to write a program to your computer - for POSIX-compilant OSes, this one could help you out.

Upvotes: 1

Related Questions