Exemplo n.º 1
0
    def __init__(self, pins, thresholds):
        super(RaspPi, self).__init__(pins, thresholds, "RPi")

        self.flow_sensor = GroveFlowSensor(self.pins['sensors']['flow-sensor'])
        self.sound_sensor = SoundSensor(self.pins['sensors']['sound-sensor'],
                                        self.thresholds['sound'])
        self.ultrasonic_ranger = UltraSonicRanger(
            self.pins['sensors']['ultrasonic-ranger'],
            self.thresholds['ultrasonic'])
        self.lcd = GroveRGB()
        self.buttons = {}
        self.leds = {}

        if (pins):
            for button in pins['buttons']:
                if pins['buttons'][button] > 0:
                    self.buttons[button] = GroveButton(pins['buttons'][button],
                                                       button)

            for led in pins['led']:
                if (pins['led'][led] > 0):
                    self.leds[led] = GroveLED(pins['led'][led], led)

        self.print_to_screen('Simple Beer \n Service 4.0', RGB['orange'])
        for c in range(0, 255):
            self.lcd.setRGB(c, 255 - c, 0)
            time.sleep(0.01)
            self.lcd.setRGB(0, 255, 0)

        self.print_to_screen('IP Address: \n ' + Tools.get_ip_address(),
                             [0, 128, 64])
        time.sleep(10)
Exemplo n.º 2
0
    def __init__(self, pins, thresholds):
        super(RaspPi,self).__init__(pins, thresholds, "RPi")

        self.flow_sensor = GroveFlowSensor(self.pins['sensors']['flow-sensor'])
        self.sound_sensor = SoundSensor(self.pins['sensors']['sound-sensor'], self.thresholds['sound'])
        self.ultrasonic_ranger = UltraSonicRanger(self.pins['sensors']['ultrasonic-ranger'], self.thresholds['ultrasonic'])
        self.lcd = GroveRGB()
        self.buttons = {}
        self.leds = {}

        if (pins):
            for button in pins['buttons']:
                if pins['buttons'][button]>0:
                    self.buttons[button] = GroveButton(pins['buttons'][button],button)

            for led in pins['led']:
                if (pins['led'][led]>0):
                    self.leds[led] = GroveLED(pins['led'][led],led)

        self.print_to_screen('Simple Beer \n Service 4.0', RGB['orange'])
        for c in range(0,255):
            self.lcd.setRGB(c,255-c,0)
            time.sleep(0.01)
            self.lcd.setRGB(0,255,0)

        self.print_to_screen('IP Address: \n '+Tools.get_ip_address(), [0,128,64])
        time.sleep(10)
Exemplo n.º 3
0
    def __init__(self, pins, thresholds):
        super(LegacyRaspPi,self).__init__(pins, thresholds, "RPi")
        GPIO.cleanup()
        GPIO.setmode(GPIO.BOARD)
        self.flow_sensor = LegacyFlowSensor(self.pins['sensors']['flow-sensor'])
        self.sound_sensor = LegacySoundSensor(self.pins['sensors']['sound-sensor'], self.thresholds['sound'])
        self.leds = {}
        self.buttons = {}

#        for button in pins['buttons']:
#            if pins['buttons'][button]>0:
#                self.buttons[button] = GroveButton(pins['buttons'][button], button)

        for led in pins['led']:
            if (pins['led'][led]>0):
                self.leds[led] = LegacyLED(pins['led'][led], led)

        self.print_to_screen('Simple Beer \n Service 4.0', RGB['orange'])
        self.print_to_screen('IP Address: \n '+Tools.get_ip_address(), [0,128,64])
        time.sleep(10)
Exemplo n.º 4
0
    def __init__(self, pins, thresholds):
        super(LegacyRaspPi, self).__init__(pins, thresholds, "RPi")
        GPIO.cleanup()
        GPIO.setmode(GPIO.BOARD)
        self.flow_sensor = LegacyFlowSensor(
            self.pins['sensors']['flow-sensor'])
        self.sound_sensor = LegacySoundSensor(
            self.pins['sensors']['sound-sensor'], self.thresholds['sound'])
        self.leds = {}
        self.buttons = {}

        #        for button in pins['buttons']:
        #            if pins['buttons'][button]>0:
        #                self.buttons[button] = GroveButton(pins['buttons'][button], button)

        for led in pins['led']:
            if (pins['led'][led] > 0):
                self.leds[led] = LegacyLED(pins['led'][led], led)

        self.print_to_screen('Simple Beer \n Service 4.0', RGB['orange'])
        self.print_to_screen('IP Address: \n ' + Tools.get_ip_address(),
                             [0, 128, 64])
        time.sleep(10)
Exemplo n.º 5
0
 def __init__(self, pins, thresholds, type):
     self.pins = pins
     self.type = type
     self.thresholds = thresholds
     Tools.log('Simple Beer Service 4.0', 2)
     Tools.log('IP Address: %s' % Tools.get_ip_address(), 2)
Exemplo n.º 6
0
 def __init__(self, pins, thresholds, type):
     self.pins = pins
     self.type = type
     self.thresholds = thresholds
     Tools.log('Simple Beer Service 4.0',2)
     Tools.log('IP Address: %s' % Tools.get_ip_address(),2)
Exemplo n.º 7
0
 def __init__(self, pins, thresholds, type):
     self.pins = pins
     self.type = type
     self.thresholds = thresholds
     Tools.log("Simple Home Monitor v1", 2)
     Tools.log("IP Address: %s" % Tools.get_ip_address(), 2)