$25
CS 362 Lab 7
Learning Goals:
• Be able to have two Arduinos communicate with each other.
Lab: Due Wednesday 3/20/19
For this lab, you may work with a partner. If you have two Arduino devices, you can work
alone.
For this lab:
• connect two Arduino's via a hardwired serial connection (no usb cable) (digital pins 0 and 1)
• connect a button and an external LED to each device
• pressing the button on one Arduino should cause the other Arduino's LED to change state
(on to off, or off to on)
• Button press on one Arduino should toggle the state of the LED on the other (on/off) and not
keep the LED lit while being pressed
• utilize the 16x2 display for debugging
• refer to lab 6 for all the info about serial communication and lab2 for maintaining led states
with button presses .
Hints:
• Both boards have to share the same ground in order for the serial communication to work
properly
The same code MUST run on both Arduinos. You and your partner may submit the same code, if
you both have worked on it together. You may do this via a single group submission in
Gradescope. Both of you are to demonstrate the lab together.
To be considered completed “on time”, this Lab needs to be demonstrated by end of Lab on
Wednesday 3/20/2019. Your code must be submitted to Gradescope BEFORE you demo your
lab!
Late Policy
• Late Submission - Submitted and/or demonstrated later that week (before Friday 3/22/19
11:59pm) 25% Penalty
• Late submission – Submitted and/or demonstrated during the following week (before
Friday 4/5/19 11:59pm) 50% Penalty
What should I include with my .ino Code File?
As with any code file, it should be written in Good Coding Style: in a manner that will help other
people read and understand the intent, purpose, operation of the code. So your code must
include:
• Name the .ino file with your NetId and Lab Number
o I.E. something like: ptroy4Lab2.ino
• Header Comments (including the following)
CS 362 Lab 7 Spring 2019
o // FirstName LastName, UIN and NetID
o // Lab x - Title
o // Description - what is this code supposed to do?
o // Include any assumptions you may have made, what do you expect from the
hardware, pinouts, particular arduino versions, etc.
o // References - where did you find code snippets, ideas, inspirations? if no
references used say: "no references used"
• Code is well documented/formatted with comments, indentations, and
descriptive variable names
• Actual code - the functions in the cpp/ino file