1 of 16

LED Light Project

CS113 - Discrete Mathematics

Jotsaroop Singh�Abdarrahman Ayazz

2 of 16

Preview

Our project is an led board in which we alternate between different states for the LEDs to light up. It’s a good way to physically represent truth tables as learned in Discrete Mathematics.

3 of 16

Specs

The electronic components of our project that we are planning on utilizing are;

  • Arduino Uno
  • Breadboard
  • 4 Led lights
  • 4 220 ohm Resistors
  • 5 jumper cables (male to male)
    • 4 used to connect the LEDs and 1 which grounds the circuit

4 of 16

Setbacks and Problems

  • We struggled with utilizing the Raspberry Pi
    • No monitor for Raspberry Pi output
    • We had to figure out a “headless” set up
      • This was inefficient as the Raspberry Pi only connected to private networks, making working together very difficult (Abdarrahman had been injured the week the project began)
    • We ultimately realized it was out of our means to use
  • Switched to Arduino towards end of the project

5 of 16

allOn() Function Truth Table

We utilized this table to have an idea of how we will program our all on function conceptually.

6 of 16

allOn() Function

7 of 16

All On Function In Action

8 of 16

rowBlink() Truth Table

We utilized this table to have an idea of how we will program our blink function conceptually.

9 of 16

rowBlink() Function

10 of 16

Row Blink Function in Action

11 of 16

flow() Truth table

We utilized this table to have an idea of how we will program our flow function conceptually.

12 of 16

flow() Function

13 of 16

Flow Function in Action

14 of 16

Array

We decided to create an array of LED pins to help with the storage of the valid pin inputs in the Arduino

15 of 16

Set Theory

The set theory was implemented in our program when we had to utilize sets to represent our led pins and whether they were on or not.

We can refer to ledPins[] as a set called A which contains the elements{8,9,10,11}

We can refer to High and Low as a set called B which contains the elements{1,0}, 1 for on and 0 for off.

16 of 16

Quantifiers

Building off of the ideas in terms of set theory, we can also look at the program as quantifier based.

Specifically, when the program looks for valid LEDs connected to the correct pins, it utilizes an existential quantifier.

That is, there exist valid pins 8, 9, 10, 11 such that the program can give an output (in the case of all on, set each pin to 1 or “true”).