Skip to content

Instantly share code, notes, and snippets.

@abishur
abishur / control.php
Created February 15, 2013 03:40
php web control for GPIO of raspberry pi. The main application is for a spinkler system, but ultimately it can do automatic control of any relay control by the raspberry pi
<?php
session_start();
//////////////////////////////
// EDIT THESE TWO VARIABLES //
//////////////////////////////
$MySQLUsername = "USERNAME HERE";
$MySQLPassword = "PASSWORD HERE";
/////////////////////////////////
// DO NOT EDIT BELOW THIS LINE //
@abishur
abishur / gpio.sql
Last active December 28, 2016 11:35
-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 28, 2013 at 07:07 PM
-- Server version: 5.5.28
-- PHP Version: 5.4.4-11
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@abishur
abishur / my_sql_header.h
Last active December 12, 2015 03:28
Program for gpio control and associate headers, specifically for sprinkler control. Let's you input start days, start time, and duration. Also has a manual mode.
/*
* File: my_sql_header.h
*
* This was written by Matthew Bennett
* (abishur on the raspberry pi forums - http://www.raspberrypi.org/phpBB3/)
*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
@abishur
abishur / menu_launcher.py
Last active July 28, 2024 19:57
A simple menu system using python for the Terminal (Framebufer)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Topmenu and the submenus are based of the example found at this location http://blog.skeltonnetworks.com/2010/03/python-curses-custom-menu/
# The rest of the work was done by Matthew Bennett and he requests you keep these two mentions when you reuse the code :-)
# Basic code refactoring by Andrew Scheller
from time import sleep
import curses, os #curses is the interface for capturing key presses on the menu, os launches the files
screen = curses.initscr() #initializes a new window for capturing key presses
curses.noecho() # Disables automatic echoing of key presses (prevents program from input each key twice)