Pcomp Lab: Asynchronous Serial Communication

Here we’re learning about the basics of Asynchronous Serial Communication.  We start by building a circuit with a digital switch-button and an accelerometer.  Here’s how it looks:IMG_1554

Once we hook that up to our computer (using the USB– our friend in the world of Serial Communication :), we try a series of Serial.println to learn the basics of Serial Monitor print-outs and data exchange in the form of binary or ASCII.

We end up with a serial print out, well punctuated, of our Accelerometer X and Y readings as well as the on/off state of the Switch: IMG_1555

This is printing out readings constantly, and we can’t keep track of them, so we learn to implement the HANDSHAKE or “Call & Response” method of Serial Communication to fix this.  By adding an “if” statement at the beginning of our loop, we only get the Serial.println IF data is requested– we must send info via the serial monitor to receive a reading (before this, our setup function dictates the monitor will constantly print “hello” until data is requested).

Anyway, this lab does get some creative juices flowing— Serial Communication is really the guts of most of what we’ve been doing so far without realizing it.  Understanding more about how it works enables me to think in terms of applicative terms, for instance, in Game Design terms.

Let’s say I want to design a board game with physical cards that have digital components.  So you place the cards on the conductive game board, and it reads data, prints it to a digital screen integrated into the board, and then waits for the opposing user to input data before returning the results to each player.  This is a simple meditation in order of operations, in terms of information flowing back and forth between two physical objects, via a third physical object.  A deeper understanding of serial communication will allow me to execute this physio-digital game board!

Stay tuned.

Categories: itp, lab, pcomp

Tagged as: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s