Intro to Computer Engineering

Studio 2 - Circuits

Click here to access the Canvas page with the repository for this studio.

========

What is a circuit?

This is a pretty complex question, and there are many other topics needed to give a good answer.

Here are some resources:

What you need to know for this class

We do not expect anyone to be an electrical engineer. We do, however, need you to understand the very basics of circuits and electricity so you can better understand your Arduino.

Please know the basics of these subjects before moving on:

========

Today’s studio

Armed with your new circuit knowledge, you will be modeling studio 1’s Binary Counter with 3 LEDs. We’ll then follow that with the construction and exercising of the LCD display.

Objectives

By the end of studio, you should know:

Setup

Important: for your first couple of circuits, let a TA check over them before plugging in your Arduino

Wiring up the Binary Counter

Warning messing with electricity is never a good idea. The Arduino is a pretty safe place to start but you should develop a healthy respect for electricity.

Warning: always disconnect power from the Arduino before doing (or changing) any wiring. An accidental mis-connection can damage either/both your Arduino and/or the parts you are connecting. Double check work before applying power

Here is your RedBoard:

Source: learn.sparkfun.com/tutorials/redboard-hookup-guide

Here is how to wire up one LED:

Wiring up an LED

If you were to issue the command digitalWrite(3,HIGH); after wiring one LED as indicated in the video, would the LED light up, or be dark?

Check with a TA before moving on

Let there be Light!

The Code to make an LED at Pin3 Light up:

void setup() {
	pinMode(3,OUTPUT);
	digitalWrite(3,HIGH);  //HIGH => On and LOW => Off
}

========

The Final Product

Here is what your LEDs should do:

LED Counter

========

LCD display

In subsequent assignments, we will want to display text locally (rather than on the PC). Following the directions in SparkFun’s tutorial, construct the LCD display circuitry and make it operational.

In Studio 1, the binary counter sent output to the Serial Monitor on the PC. Add lcd.print() statements to your Arduino sketch to display the current count on the LCD display.

========

Finishing up

  1. Make sure to commit and push your project.

    Eclipse may not be aware of changes to files that were made outside of Eclipse, such as changes you make in the Arduino IDE. Right click on the project and select Refresh to force Eclipse to search for updates.

    In Eclipse’s package explorer, any files you have modified since your last commit are prefixed with a >.

    Right-click the outer-most folder (you want to commit everything within), and choose Team > Commit.... Write a helpful message and press OK.

    You can verify that your changes went to the server by opening the repository URL at GitHub in any web browser. Browse the files to make sure your changes committed.

  2. Get checked out by a TA.

Repository structure for this studio:

========

Key Concepts

This is a mental checklist for you to see what the Studio is designed to teach you.

Generated at 2024-02-20 19:17:20 +0000.
Page written by Ben Stolovitz and Sean Schaffer.