From f89e7b3923f41bcb82b60ce92a03a1a4205c7cc9 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Sun, 15 Dec 2019 00:12:59 +0000 Subject: [PATCH] add cli-meter.py --- cli-meter.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cli-meter.py diff --git a/cli-meter.py b/cli-meter.py new file mode 100644 index 0000000..d7505cc --- /dev/null +++ b/cli-meter.py @@ -0,0 +1,21 @@ +""" +CLI Meter +==================================================================== +Takes a reading of the light using the meter attached via to the +intended Raspberry PI. The reading is the sent to a server where the +reading is stored. The intended use for this script is to be run via +the command-line without the need for a G.U.I. This should be the +version used when the "Return to Ritherdon" project is live. +""" +import json +import RPi.GPIO as GPIO +import time, math +import requests +from datetime import datetime + +# Using BCM (Broadcom) names when referencing the GPIO pins. +GPIO.setmode(GPIO.BCM) + +a_pin = 18 # Charges the capacitor. +b_pin = 23 # Discharges the capacitor. +