Skip to content

Instantly share code, notes, and snippets.

View JohnPersano's full-sized avatar

John P. JohnPersano

View GitHub Profile
@JohnPersano
JohnPersano / sketch.c
Created December 16, 2015 05:13
Group 3 Application Sketch
#include <LiquidCrystal.h>
#include<stdlib.h>
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
float mpgs[10];
int counter = 0;
const int numReadings = 10;
float readings[numReadings];
@JohnPersano
JohnPersano / toolbar.xml
Created October 24, 2014 01:02
ToolBar - Theme.AppCompat.Light.NoActionBar with dark ToolBar
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:compat="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
compat:theme="?attr/actionBarStyle"/>
@JohnPersano
JohnPersano / styles.xml
Last active November 27, 2020 17:07
Styles - Theme.AppCompat.Light.NoActionBar with dark ToolBar
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Custom.Dark" parent="Theme.AppCompat.NoActionBar">
<item name="actionBarStyle">@style/Theme.AppCompat</item>
</style>
<style name="Theme.Custom.Light" parent="Theme.AppCompat.Light.NoActionBar">
@JohnPersano
JohnPersano / Fan.c
Last active August 29, 2015 14:03
Jasper Fan Worker
#include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int PIN = 4;
void getStatus(){
printf("%d\n", digitalRead(PIN));
@JohnPersano
JohnPersano / DHT.py
Created July 8, 2014 18:51
Jasper Temperature Module
import random
import re
import subprocess
import time
import serial
WORDS = ["TEMPERATURE", "TEMP"]
SERIAL_REQUEST = "T"
GPIO_PIN_FAN = "17"
@JohnPersano
JohnPersano / Fan.py
Last active February 13, 2016 12:03
Jasper Fan Module
# -*- coding: utf-8 -*-
import random
import re
import subprocess
import os
WORDS = ["FAN", "YES", "NO", "ON", "OFF"]
GPIO_PIN_FAN = "17";