RobotGeek 101: Serial Communication Reference

This lesson is part of the RobotGeek 101 Learning Series. If you haven't already, please download the example sketches, and follow through the Geekduino Getting Started Guide to handle the foundations of using the Arduino IDE in conjunction with the Geekduino.

Welcome to RobotGeek 101 : Serial Communication Reference. This reference expands upon the concepts covered in the Serial Communication Introduction, and introduces more advanced concepts that will give you a more comprehensive knowledge of the workings of Serial Communication.

Parts used in this lesson:

These parts and everything you need to complete chapters 1-7 in RobotGeek 101 are available in the RobotGeek Basic Experimenter's Kit.

Contents:

Introduction

E-serialWithoutDelay

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's print a serial message at a fixed rate without the use of delay(). Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 00 - serialCommunication > E-serialWithoutDelay

Back to Contents

F-serialFormatting

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's display data to the serial monitor in a variety of formats. Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 00 - serialCommunication > F-serialFormatting

Back to Contents

G-serialWrite

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's use the Serial.write() function to send individual bytes on the serial port. Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 00 - serialCommunication > G-serialWrite

Back to Contents

H-softwareSerial

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's start a software serial instance on pins 10/11 as well as a hardware serial port. Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 00 - serialCommunication > H-softwareSerial

Back to Contents

I-readParsing

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's use Arduino's serial functions to easily parse integers and floats from a standard serial input. Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 00 - serialCommunication > I-readParsing

Back to Contents

J-Commander

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's learn about the commander packet protocol. Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 00 - serialCommunication > J-Commander

Back to Contents

K-numberGuesser

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's generate a random number and prompt you to guess the number. Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 00 - serialCommunication > K-numberGuesser

Back to Contents

L-adventureTextGame

code.png Click here to expand the code

diagram.png Click here to expand the diagram

Let's create a short 'Choose Your Own Adventure' style game! Open the following sketch in your Arduino IDE

File > Sketchbook > RobotGeek sketches > RG101 > 00 - serialCommunication > L-adventureTextGame

Back to Contents

Serial Communication Examples from Arduino

Feedback Form


Search