class Presion(object):
    """docstring for Presion"""
    def __init__(self, address):
        self.adc = ADC([address])

    def read_sensor(self):
        return self.adc.read_addresses()
def get_data_dict(adc_inputs):
    adc = ADC(adc_inputs)
    data_dict = get_time_dict()
    data_dict.update(temp())
    _, adc_dict = adc.read_addresses()
    data_dict.update(adc_dict)
    ultrasonic = Ultrasonic(trigger=3, echo=5)
    data_dict.update(ultrasonic.read_distance())
    return data_dict
Example #3
0
def get_data_dict(adc_inputs):
    adc = ADC(adc_inputs)
    data_dict = get_time_dict()
    data_dict.update(temp())
    _, adc_dict = adc.read_addresses()
    data_dict.update(adc_dict)
    ultrasonic = Ultrasonic(trigger=trigger_pin, echo=echo_pin)
    u_distance = ultrasonic.read_distance()
    
    if u_distance['u_distance'] <= 20:
        turn_camera_flash(True)
    else:
        turn_camera_flash(False)
    
    data_dict.update(u_distance)
    return data_dict
def readADC():
    adc = ADC([0])
    return adc.read_addresses()