CSCI 345: Lab 9

Arduino to Computer
Due: 10PM on Monday, April 27th

In this lab, you should learn:

  • How to communicate between your computer and programs running on your computer.

To complete this lab, you will need:

  • A computer.
  • An arduino.
  • A USB cable to connect your arduino to your computer.
  • An LED.
  • A resistor appropriate to your LED.

Part 0 - Github

Click here to create your github repo for this lab.

Part 1 - Processing

Follow this guide to learn how to communicate between your arduino and the programming language processing.

Part 2 - Install Pyserial

Now we'll use the pyserial library to communicate between arduino and python. First you will need to install pyserial. Follow the instructions here to install it.

Part 3 - Send Commands from Python to your Arduino

Follow this guide to control an LED connected to your arduino from python. (Note: Skip the first two steps here, which are to install pyserial and install the arduino IDE.

Part 4 - Send Data from your Arduino to Python

Follow this guide to read data from your arduino into python. You can skip the last part of the tutorial which uses matplotlib.

Part 5 - Put it together and get creative

You will need to write two different programs for this. One of them should be in python, and one in processing. One should send data to your arduino and have it react in some way, and the other should read data from your arduino and display it on your computer in some way.

Handin

You will submit your assignment by posting a comment on the piazza thread for lab 9. Your post should include a link to two different videos, one for each program, and a link to a github repository that contains your arduino code.


C. Taylor