Skip to content

Instantly share code, notes, and snippets.

@Alexs2424
Alexs2424 / final_project_lights.swift
Created May 20, 2019 02:20
Swift Version of the Lights Code to get it to work.
if let hexBackgroundColor = colorsToUse.background.toHex() {
print("BACKGROUND: \(hexBackgroundColor)")
let backgroundRed = self.getRed(forColor: colorsToUse.background)
let backgroundGreen = self.getGreen(forColor: colorsToUse.background)
let backgroundBlue = self.getBlue(forColor: colorsToUse.background)
print("RED: \(backgroundRed)")
if let red = backgroundRed, let blue = backgroundBlue, let green = backgroundGreen {
let redBackgroundStr = self.stringForRGBValue(value: red)
print("RED STR: \(redBackgroundStr)")
let greenBackgroundStr = self.stringForRGBValue(value: green)
@Alexs2424
Alexs2424 / physical_final_proj.cc
Created May 20, 2019 02:06
Here's the code I wrote for use with my final project.
// Adafruit IO Subscription Example
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Written by Todd Treece for Adafruit Industries
// Copyright (c) 2016 Adafruit Industries
// Licensed under the MIT license.
//