1
0
Fork 0
Browse Source

add cli-meter.py

pull/1/head
Craig Oates 4 years ago
parent
commit
f89e7b3923
  1. 21
      cli-meter.py

21
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.