1
0
Fork 0
A Python based project which measures the light levels of an environment and forwards those measurements on to a server. This project is one of several which forms the software-side of the 'Return to Ritherdon' project.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 

21 lines
679 B

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