Difference between revisions of "User:270o"

From CSclasswiki
Jump to: navigation, search
(Resources)
(References)
Line 124: Line 124:
  
 
=References=
 
=References=
 +
 +
[http://educ8s.tv/arduino-8x8-led-matrix-tutorial/] Arduino 8×8 LED Matrix Tutorial: This tutorial

Revision as of 03:49, 2 May 2020

Introduction

Welcome to the Wiki Page of my Final Project for CSC270: Digital Circuits Systems. The purpose of this project is to create three configurations using various Elegoo Gadgets including a Mega2560 Arduino, Raspberry Pi and a 64-LED matrix. These configurations will each be able to execute a task as detailed in the outline.

Plan

Outline

The objectives explained in the Introduction will be achieved in 3 parts:

  1. Connect a 64-LED matrix display to a Mega2560 Arduino and program it to display my name, "L I Z E T T E".
  1. Demonstrate a master - worker model by establishing an i2c link between a Raspberry Pi and a Mega2560 Arduino. The Raspberry Pi will send a word to the Arduino. The Arduino will implement a Atbash Cipher on the word, then send it back to the Raspberry Pi.
  1. Retrieve Seattle, Washington's current weather from weather.com using a Raspberry Pi. The Raspberry Pi will send it to the Arduino, which will display the data on the 64-LED matrix display.

I will be programming the Raspberry Pi and Arduino in C.

Materials

  1. Mega2560 Arduino
  2. Raspberry Pi 3
  3. 64-LED Matrix
  4. Breadboard
  5. Wires
  6. Resistors

Resources

Google Chrome LED Byte Generator: This is used to generate the byte array matrix for each letter that is displayed on the 64-LED matrix in Part 1.

Part 1: Connect and Program 64-LED matrix to Arduino

Summary

Images & Videos

Sketch

/*
 * Lizette Carpenter 
 * Part 64-LED Matrix and Arduino Configuration 
 * The 64-LED Matrix will display my name: "L I Z E T T E"
 * 
 * References: 
 * LED Control library: 
 * Google Chrome app: LED Byte Generator 
 */

//Include the following library 
#include <LedControl.h>

//Declare the pins of the Arduino following how it is connected to the pins of the LED Matrix
int DIN = 12;
int CS = 11; 
int CLK = 10; 

//Declare the byte arrays which represent the letters that will display on the LED Matrix 
byte l[8] = {0x0,0x40,0x40,0x40,0x40,0x40,0x7e,0x0};
byte i[8] = {0x0,0x8,0x8,0x8,0x8,0x8,0x8,0x0};
byte z[8] = {0x0,0x7e,0x4,0x8,0x10,0x20,0x7e,0x0};
byte e[8] = {0x0,0x7c,0x40,0x7c,0x40,0x40,0x7c,0x0};
byte t[8] = {0x0,0x7f,0x8,0x8,0x8,0x8,0x8,0x0};
byte T[8] = {0x0,0x0,0xfe,0x10,0x10,0x10,0x10,0x10};


//Initialize the LED control library 
LedControl lc=LedControl(DIN, CLK, CS, 0);

void setup() {
  lc.shutdown(0, false); 
  lc.setIntensity(0,15); 
  lc.clearDisplay(0); 
  
}

void loop() {
  printByte(l); 
  delay(1000);

  printByte(i); 
  delay(1000);

  printByte(z); 
  delay(1000);

  printByte(e); 
  delay(1000);

  printByte(t); 
  delay(1000);

  printByte(T); 
  delay(1000);

  printByte(e); 
  delay(1000);
}

//Loops through each byte array and displays its corresponding letter to the LED Matrix. 
void printByte(byte character []) {
  int i = 0; 
  for (i = 0; i<8; i++) {
    lc.setRow(0, i, character[i]); 
  } 
}

Part 2: i2c link between Raspberry Pi to the Arduino

Summary

Images & Videos

Sketch

Part 3: Combining Part 1 and Part 2

Summary

Images & Videos

Sketch

References

[1] Arduino 8×8 LED Matrix Tutorial: This tutorial