Labs: Serial Communication

The following labs are about communicating serially between your Arduino and other devices.

Fundamentals

  • Labs: Serial Communication
    The following labs are about communicating serially between your Arduino and other devices. Fundamentals p5.js webserial library p5.js serialport library
  • Lab: Intro to Asynchronous Serial Communications
    In this lab, you’ll get to know serial communication from a microcontroller to your personal computer a bit more in depth, so that you’re ready to start writing programs in other languages on your computer to interact with our microcontroller.

p5.js webserial library

  • Lab: Serial Input to p5.js Using the p5.webserial Library
    This lab uses a p5.js library called p5.WebSerial to make it easy in p5.js. In this lab, you’ll generate an analog output value from a potentiometer, then send that value via asynchronous serial communication to P5.js. You’ll use that value in P5.js to draw a graph. Web browsers have traditionally been designed to be separate from the ...
  • Lab: Serial Output From p5.js Using the p5.webserial Library
    In this lab you’ll learn how to send data from p5.js to a microcontroller using asynchronous serial communication. Overview When you use the p5.webserial library for P5.js, it uses the W3C’s WebSerial API to allow your browser to communicate with serial ports on your computer. This lab shows you how to use P5 to control ...
  • Lab: Two-Way (Duplex) Serial Communication Using An Arduino and the p5.webserial Library
    Introduction In the Introduction to Asynchronous Serial Communication lab, you learned about various methods for managing the communications between computers via asynchronous serial communication. These included formatting your data as ASCII-encoded strings or raw serial bytes and managing the flow of data using handshaking. In the P5.js WebSerial Input Lab, you sent data from one sensor to ...
  • Lab: Serial IMU Output to p5.js Using p5.webserial
    In this exercise you’ll read the built-in Inertial Motion Unit on the Arduino Nano 33 IoT, then feed its output into a Madgwick filter to determine heading, pitch, and roll of the board. Then you’ll send the output of that serially to p5.js and use it to move a virtual version of the Nano onscreen.

p5.js serialport library