Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Justin Bowen TonsOfFun

🏠
Working from home
View GitHub Profile
View pump.py
import os
import time
def run_pump(id=1, duration=0):
relay_on(id)
time.sleep(duration)
relay_off(id)
def relay_on(id=1):
os.system('usbrelay 5291D_'+str(id)+'=1')
View read_serial.py
import serial
from serial.tools import list_ports
ser = serial.Serial(list_ports.comports()[1].device, 9600)
while True:
print(ser.readline())
View water_ph.ino
//**THIS CODE WILL WORK ON ANY ARDUINO**
//This code was written to be easy to understand.
//Modify this code as you see fit.
//This code will output data to the Arduino serial monitor.
//Type commands into the Arduino serial monitor to control the pH circuit.
//An Arduino UNO was used to test this code.
//This code was written in the Arduino 1.8.5 IDE
//This code was last tested 1/2018
View air.ino
#include <Wire.h>
#include <Adafruit_AM2315.h>
/***************************************************
This is an example for the AM2315 Humidity + Temp sensor
Designed specifically to work with the Adafruit BMP085 Breakout
----> https://www.adafruit.com/products/1293
These displays use I2C to communicate, 2 pins are required to
View soil.ino
#include <Wire.h>
#include <Adafruit_AM2315.h>
/***************************************************
This is an example for the AM2315 Humidity + Temp sensor
Designed specifically to work with the Adafruit BMP085 Breakout
----> https://www.adafruit.com/products/1293
These displays use I2C to communicate, 2 pins are required to
interface
Adafruit invests time and resources providing this open source code,
@TonsOfFun
TonsOfFun / leaf_area.py
Created Jan 16, 2019
GreenThumb CV Leaf Area Filter
View leaf_area.py
import numpy as np
import imutils
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
# Defined bounds using https://github.com/jrosebr1/imutils/blob/master/bin/range-detector
leaf_lower = (29, 0, 0)
leaf_upper = (255, 255, 128)
@TonsOfFun
TonsOfFun / AM2315_air.ino
Last active Mar 6, 2019
Using this for Arduino sensor readings
View AM2315_air.ino
#include <Wire.h>
#include <Adafruit_AM2315.h>
/***************************************************
This is an example for the AM2315 Humidity + Temp sensor
Designed specifically to work with the Adafruit BMP085 Breakout
----> https://www.adafruit.com/products/1293
These displays use I2C to communicate, 2 pins are required to
View capture.py
# USAGE
# python save_key_events.py --output output
# import the necessary packages
from greenthumb.note import Note
from uuid import getnode as get_mac
from io import BytesIO
from picamera import PiCamera
import datetime
import imutils
View Before and After Cleaning Up the Contours.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Label Buds.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.