July Wednesday 18

Bookmark and Share

Related Articles...

MILWAUKEE WI Arduino Make Space


WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Arduino Make Space Acquired!

Email :

COASMailBox @ gmail.com

MILWAUKEE WI Raspberry Pi Meet Up Make Space


WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Raspberry Pi Make Space Acquired!

Email :

COASMailBox @ gmail.com

MILWAUKEE WI Internet of Things (IoT) Meet Up Make Space


WANTED: Angle Investor Start-Up Funding

Large Industrial Zoned Make Space Acquired!

Full Advanced Fabrication Facility, machine Shop, Welding, Electronics Lab Equipment Acquired!

Email :

COASMailBox @ gmail.com

MILWAUKEE WI Machine Repair, & Installation  - Tier 1 Business Support

Machine Technician Mechanic 20+ Years  Personal Experienced In Industrial Factory Machine Servicing, Rebuilding, Installation And Repair - Plus A 35+ Years Experienced Computer Engineer Service Technician Team Ready For Your Outsourced Market Advantage Needs!

Hartung Industrial - Member - CGI Science & Technology Group

Email :

COASMailBox @ gmail.com



Arduino Serial Communications

2017 OCTOBER | by Gene Casanova

Senior Computer Systems Engineer

Working With Arduino USB Serial Port

USB Serial Port

A "FTDI" FT232RL USB interface IC chip provided onboard provides serial communication through USB and FTDI drivers (included with Windows version of the Arduino software) provide a virtual "com" port to software on a USB-connected computer to an Durian systemboard.

USB Communications LEDs

The RX LED and TX LED on the systemboard will flash when data is being transmitted through the FTDI IC chip and USB connection to the USB-connected computer.  The LEDs are used for serial communication on pins 0 and 1.

A Basic Arduino Serial Sketch

Connect an Arduino to a computer with the Arduino IDE developer software application installed, using a USB serial cable.

Start a new Arduino sketch in the IDE and enter the following code.

 * Hello World!
 * Sketch for Arduino. 
 * This Arduino "sketch" illustrates how to send data out the USB port to
 * a computer connected to the Arduino USB port.
void setup()                   // Execute once, when the sketch starts.
  Serial.begin(9600);          // Serial.begin() from Serial library.
								 // Establish a USB port connection with a baud rate of 9600bps.

  Serial.println("Hello world!");  // send content between double quotes "" and one line break character. 

The Arduino requires void setup(){} and void loop().

"Serial.begin()" is a library procedure-reference.  "Serial" is the name of a library and "begin" is the name of a procedure inside the library.

If no library name is given, then it means the procedure is in the 'default' collection of procedures we use.

Serial."println"() - "println" stands for "print line".  This process sends the content between the "" double quotes to the default Arduino USB serial port.

After entering this sketch, save the file.  Next, upload it to the Arduino.  Open a IDE console window to view the sketch output.

A Basic Arduino Serial Echo

Start the Arduino IDE software application and start a new "sketch".

Put the following sketch into the IDE window and save.

/* Serial ECHO
 *   by Gene Casanova
 *   When the Arduino receives a byte on the receive pin of the serial port,
 *   the byte is sent out on the transmit pin of the serial port,
 *   back to the sender.
/* Use variable named "byteRead" to store incoming data */
byte byteRead;

void setup() {
// Enable Serial Protocol:

void loop() {
   // Check For Incoming Data:
  if (Serial.available()) {
   // Read Received byte:
    byteRead = Serial.read();
    // ECHO received value - Send Value Out Serial Port:

Upload this sketch to a connected Arduino UNO systemboard.

sketch has been uploaded to the Arduino. Open the Serial monitor, which looks like a magnifying glass at the top right section of the Arduino IDE. Please note, that you need to keep the USB connected to the Arduino during this process, as the USB cable is your communication link between your computer and the Arduino.

Open an Arduino IDE console window and type in characters.  Every character typed in will be displayed in the console.  Every character entered, will send out through the computer USB port into the Arduino.  The Arduino sketch will received the character and send it back through the transmit port on the Arduino, into the receive USB pin on the computer.  This action is referred to as an echo in the electronics and communications industries.

Use The Technology Wisely & Keep It Simple

- Cheers!

Gene Casanova

Need More?   Need Help? ........Software, Network, System & Data Center Builder & Developer | Development Services Available - Freelance Small Jobs; To Outsourced Long Term Service Provider Contract Labor Available.

CGI Computer Wares | EST 1979

Send E-MailCONTACT: [click]@CGIComputerWares.com