This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stolen from https://raspberrypi.stackexchange.com/questions/53665/how-to-use-a-4x4-keypad-in-python | |
from pad4pi import rpi_gpio | |
# Setup Keypad | |
KEYPAD = [ | |
["1","2","3","A"], | |
["4","5","6","B"], | |
["7","8","9","C"], | |
["*","0","#","D"] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as GPIO | |
import time | |
import os | |
GPIO.setmode(GPIO.BCM) | |
PIR_PIN = 25 | |
GPIO.setup(PIR_PIN, GPIO.IN) | |
def MOTION(PIR_PIN): | |
print 'Motion Detected! ' + time.ctime() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Adapted from http://learn.linksprite.com/raspberry-pi/how-to-use-4-digit-7-segment-module-on-raspberrypi/ | |
* Removes unwanted leading 0 digit on the time, goes with 12-hour format, sets brightness down to typical. | |
*/ | |
#include "TM1637.h" | |
#include <stdio.h> | |
#include <time.h> | |
#define clk 4//pins definitions for TM1637 and can be changed to other ports | |
#define dio 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns lazybot.plugins.trivia | |
(:use (lazybot registry info)) | |
(:require [clojure.string :as s] | |
[clojure.java.io :as io])) | |
(use '[incanter.stats :only (levenshtein-distance)]) | |
(def answer (atom "")) | |
(def buzzer (atom 0)) |