Skip to content
This repository was archived by the owner on Oct 12, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions 2018-04-10-LAVA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
layout: post
title: Game Night
date: 2018-04-08
categories: projects
description: A Board and Card Games Database
author: Michael Francis
author-image: https://avatars0.githubusercontent.com/u/4574480?s=460&v=4
author-bio: First Year Computer Science Masters Student at Rochester Institute of Technology
author-email: maf1144@rit.edu
author-social:
github: https://github.com/mfrancis95
linkedin: https://www.linkedin.com/in/mfrancis95/
---

## Background

In the Fall of 2017, I created a Slack channel for Computer Science House called **#game-night** (formerly known as **#card-games**). The purpose of the channel was to help the organization's members get together to play many of the fun board and card games owned by CSH. As of the Spring of 2018, the channel has really been taking off. Seeing that rise in popularity, I decided to do more with this neat corner of CSH and develop a web application that would benefit those who frequented the game nights and the organization as a whole.

## Introducing Game Night

I created a fully searchable database of our available games called **[Game Night](https://game-night.csh.rit.edu)**. When landing on the home page, the web application lists out all of the games in the database, but since it could be a lot to scroll through, there are ways in which the results can be filtered down.

The site provides a search field at the top to help users match games in the database that contain a certain keyword or string. If one happens to be familiar with regular expressions, they can use those in their queries. For example, searching with the query **b** will match all games that contain a **b** in their name, and searching with the regex query **^b** will match all games that start with a **b**. These queries are case-insensitive.

In a situation where a number of people have gathered together and would like to figure out which games support that number of players, there is an additional search option for doing just that. By clicking on the button next to the search field, a small menu will appear with a dropdown selection for choosing the number of players. Since each game in the database has properties that represent the minimum and maximum number of players it supports, all the games returned in this query will be those that have the user-specified number of players fall within those ranges. This filtering option can be combined with the textual search option.

Lastly, in that same menu there is a button for retrieving a random game from the database. This random option can be filtered by the aforementioned search options too.

## The RESTful API

I made sure from the very beginning that **Game Night** would have a RESTful API exposed for CSH members to use. The API endpoint starts at **[https://game-night.csh.rit.edu/api](https://game-night.csh.rit.edu/api)**. Similar to the index page without a search query, it returns all of CSH's games, but in JSON format. The API can be filtered by adding on URL query parameters such as **name** and **players** to the end. An example would be **[https://game-night.csh.rit.edu/api?players=10](https://game-night.csh.rit.edu/api?players=10)**, which returns all games in JSON format that support 10 players. The API endpoint for retrieving a random game is also available at **[https://game-night.csh.rit.edu/api/random](https://game-night.csh.rit.edu/api/random)** and is filterable in the same way.

## The Technology Stack

The primary tools I used to develop this web application were Python, Bootstrap 4, Flask and MongoDB. I had never used Flask before, but I was familiar with the similar Express framework used in Node.js. Going from Express to Flask, I grew to absolutely love the Flask framework even more than Express. I found its methodology of using decorators to handle responses to URL routes very elegant. I decided to use MongoDB over the more common MySQL or PostgreSQL for a few reasons:

1. It was an opportunity to learn something new.
2. Since I was only storing games in the database and there were no dependencies on other types of data, I did not need to make use of features offered by typical SQL-based relational database management systems such as foreign keys and joins.
3. MongoDB stores data in a format almost identical to JSON called BSON, meaning it is simpler to translate that to a format suitable for rendering in a view or returning in a RESTful API. Using a SQL-based RDMS typically requires an ORM.

Like many other CSH services, **Game Night** is behind OIDC authentication.

## Future Plans

A project like this has a lot of room for augmentation, and I plan on continuing work on it throughout the remainder of my time at RIT. Some features I've already thought about implementing are:

1. A way for users to upload games to the database through the web interface. Currently, only I can upload games.
2. Including games that are owned by individual CSH members. If the above feature were implemented, then a user uploading a game could specify whether they own it or it belongs to floor.
3. Keeping track of games that are up for trade or being borrowed. If a member would like to borrow a game to use outside of CSH for some time, there should be a way of updating that game's entry in the database to show that it's currently in use by someone.

Any changes made will be pushed to the project's **[GitHub repository](https://github.com/mfrancis95/game-night)**.

## Special Thanks

Thank you to Jordan for creating my OIDC client credentials and thank you to Zoe for helping me compile the initial list of the games.
52 changes: 52 additions & 0 deletions _posts/2018-04-10-LAVA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
layout: post
title: L.A.V.A.
date: 2018-04-10
categories: projects
description: L.A.V.A Stands for LED Aduio Visualizer with Acrylic. Using an arduino, a led strip, some coding in C++, and a CNC mill, you to can have you're very own L.A.V.A!
author: Mary Gentile
author-bio: First Year Human Centered Computing Major at Rochester Institute of Technology
author-email: mng7722@rit.edu
author-social:
github: https://github.com/black_roses9995
---

## Background
I decided to make L.A.V.A. after a bunch of different (failed) interations. I knew I wanted my major project this year to be something that worked with Arduino's and my friend showed me this really cool project that used a whole bunch of things-and I was in WAAY over my head. Before December I had never touched an Arduino before. Before Spring break, I'd never coded in C++ before (I did have some C# experience, but not entirely applicable). I'm still amazed I was able to do this-and it works!

## L.A.V.A

L.A.V.A. or LED Audio Visualizer with Acrylic, uses an arduino uno rev3, some jumper wires, a fully addressable LED light strip, a card that detects sound input, a trimpot for brightness control, three buttons; one to change the colour pallete, one to change the visualization effect, and then one that randomizes both a colour and visulization effect, and a lot of code.

I used the NeoPixel library to make working with the LED light strand super easy, but essentially what happens, is the mic is actively listening and picking up the "beat" of the song, which determines the visulization pattern (not the colour). This "beat" is put into a loop and replays over and over until a different "beat" or "bump" is detected, creating a new repeating loop. I coded 4 visulization effects:
1: Pulse- the basic visulation, just pulses from the center of the strand. All LEDS are all ONE colour in this one
2: PalettePulse- the second most basic. Just allows for a "gradient" to be applied to the LED strand while pulsing to the beat of the sound.
3: PaletteDance-the whole gradient oscillates to the beat, similar to a snake, and holy code a moley. Got confused on this one a few times
4: Glitter-(currently not working)creates a white sparkle on the palette to match the beat...but it's broken ATM.

I have 6 different gradients that I made up for the project-there's nothing really specially about this part, it just returns RGBs in a pretty pattern. I choose not to make any static gradients, but it is possible if you wish to do so.

In an effort to add more functionality, I used a trimpot to be able to adjust the brightness of the lights. However, I'm not entirely sure it's working to its full potentional. But it does work!

Here's a link to the full repository for the code: https://github.com/blackroses9995/LAVA/blob/master/LAVA.ino

Next I used a CNC mill to laser engrave an image onto an Acrylic sheet (NOTE: CANNOT be polycarbonate). This was probably the easiest part of the project, since all I had to do was pick an image.

And the last part is, making the wooden frame that houses L.A.V.A. I had practically ZERO experience with woodworking before starting this project and I have a HUGE shoutout to Tyler for helping me through it and making sure I kept all 10 fingers. I used a CNC Router to add groves to some wood (so that the acrylic sheet could slide in), then a table saw to to cut the wood in half vertically (that was scary as all living daylights), and a chop saw to cut them down to size, and finally a bandsaw to cut out indents in the top and bottom pieces of the wood so it would fit together. Before I added the back to the frame, I wrapped the LED strand around the inside back portion of the frame.

TL;DR: The project is a strand of fully addressable LEDs that lgiht up to the beat of the song, wrapped around an image laser etched into an acrylic sheet framed by wood. Looks cool man, I swear.


## Future Plans

This was definitely a labour of love (and confusion), but for the future, I'd love to make more visulization effects and possibly hang a permanment one on floor somewhere for all to enjoy (perhaphs with a remote control....:thinking-face:). I tried to do something I called "splatter", which would be kind of like glitter, but instead of a white dot, it would throw colour on that portion of the gradient. You know, like a paint splatter. But it didn't work... Just like my trimpot.

## What I learned, What I'd Change, and How Long it Took Me

I learned a crapton doing this project-from the basics of Ardruinos to how to code in C++ to rudimentry woodworking skills, and useful pieces of information such as, polycarbonate catches fire in a CNC mill and to always check for useful libraries before you begin coding. I spent roughly 6 hours on the woodworking portion, about 15 on the coding, 3 doing the acrylic, and then I don't even know how much on learning how to use the arduino-but it was a lot. Overall, I'd say the project took me roughly 25-30 hours over the course of 4 months.

If I were to change certain things about this project I'd make it smaller and changed the image I used on the Acrylic sheet. While it still looks SUPER cool, there's just too much going on in the picture to be able to make out the image in some of the visulization modes. I used a 11x14 acrylic sheet, and I'd probably use a 8x11 to reduce surface area if I were to redo it.

## Well...What Does it Look Like?

Here's a link to a google drive folder that contains some images and even a video of L.A.V.A. in action: https://drive.google.com/open?id=1MgXokijKBwy1GRcLIgPdTrvH44kfoKoW