def __init__(self):

        super(GroveBoard, self).__init__()

        # pin mappings
        self.pin_mappings = PinMappings(sound_pin=0,
                                        vibration_pin=2,
                                        i2c_bus=6)

        if HARDWARE_CONFIG.platform == KNOWN_PLATFORMS.firmata:
            addSubplatform(GENERIC_FIRMATA, "/dev/ttyACM0")
            self.pin_mappings += 512
            self.pin_mappings.i2c_bus = 512

        self.screen = Jhd1313m1(self.pin_mappings.i2c_bus, 0x3E, 0x62)

        self.sound = Microphone(self.pin_mappings.sound_pin)
        self.sound_ctx = thresholdContext()
        self.sound_ctx.averageReading = 0
        self.sound_ctx.runningAverage = 0
        self.sound_ctx.averagedOver = 2

        self.vibration = LDT0028(self.pin_mappings.vibration_pin)

        self.sample_time = 2
        self.sample_number = 128
Beispiel #2
0
    def __init__(self):

        super(GroveBoard, self).__init__()

        # pin mappings
        self.pin_mappings = PinMappings(i2c_bus=6)

        if HARDWARE_CONFIG.platform == KNOWN_PLATFORMS.firmata:
            addSubplatform(GENERIC_FIRMATA, "/dev/ttyACM0")
            self.pin_mappings += 512
            self.pin_mappings.i2c_bus = 512

        self.screen = Jhd1313m1(self.pin_mappings.i2c_bus, 0x3E, 0x62)
        self.accelerometer = MMA7660(self.pin_mappings.i2c_bus, 0x4C)

        # accelerometer setup
        self.ax = accel_float()
        self.ay = accel_float()
        self.az = accel_float()

        self.accelerometer.setModeStandby()
        self.accelerometer.setSampleRate(0x01)
        self.accelerometer.setModeActive()

        self.acceleration_detected = False
Beispiel #3
0
    def __init__(self):

        super(GroveBoard, self).__init__()

        # pin mappings
        self.pin_mappings = PinMappings(i2c_bus=6)

        if HARDWARE_CONFIG.platform == KNOWN_PLATFORMS.firmata:
            addSubplatform(GENERIC_FIRMATA, "/dev/ttyACM0")
            self.pin_mappings += 512
            self.pin_mappings.i2c_bus = 512

        self.screen = Jhd1313m1(self.pin_mappings.i2c_bus, 0x3E, 0x62)
Beispiel #4
0
    def __init__(self):

        super(GroveBoard, self).__init__()

        # pin mappings
        self.pin_mappings = PinMappings(mic_pin=0, i2c_bus=6)

        if HARDWARE_CONFIG.platform == KNOWN_PLATFORMS.firmata:
            addSubplatform(GENERIC_FIRMATA, "/dev/ttyACM0")
            self.pin_mappings += 512
            self.pin_mappings.i2c_bus = 512

        self.mic = Microphone(self.pin_mappings.mic_pin)
        self.screen = Jhd1313m1(self.pin_mappings.i2c_bus, 0x3E, 0x62)

        self.mic_ctx = micThresholdContext()
        self.mic_ctx.averageReading = 0
        self.mic_ctx.runningAverage = 0
        self.mic_ctx.averagedOver = 2
    def __init__(self):

        super(GroveBoard, self).__init__()

        # pin mappings
        self.pin_mappings = PinMappings(touch_pin=4, buzzer_pin=5, i2c_bus=6)

        if HARDWARE_CONFIG.platform == KNOWN_PLATFORMS.firmata:
            addSubplatform(GENERIC_FIRMATA, "/dev/ttyACM0")
            self.pin_mappings += 512
            self.pin_mappings.i2c_bus = 512

        self.screen = Jhd1313m1(self.pin_mappings.i2c_bus, 0x3E, 0x62)
        self.touch = TTP223(self.pin_mappings.touch_pin)
        self.buzzer = Gpio(self.pin_mappings.buzzer_pin)

        self.buzzer.dir(DIR_OUT)

        self.touch_state = False
        self.stop_buzzer()
Beispiel #6
0
    def __init__(self):

        super(GroveBoard, self).__init__()

        # pin mappings
        self.pin_mappings = PinMappings(
            temperature_pin=0,
            buzzer_pin=5,
            i2c_bus=6
        )
        self.voltage_adjust = 1.0

        if HARDWARE_CONFIG.platform == KNOWN_PLATFORMS.firmata:
            addSubplatform(GENERIC_FIRMATA, "/dev/ttyACM0")
            self.pin_mappings += 512
            self.pin_mappings.i2c_bus = 512
            self.voltage_adjust = 0.66

        self.screen = Jhd1313m1(self.pin_mappings.i2c_bus, 0x3E, 0x62)
        self.temperature = Temperature(self.pin_mappings.temperature_pin)
        self.buzzer = Gpio(self.pin_mappings.buzzer_pin)

        self.buzzer.dir(DIR_OUT)
    def __init__(self):

        super(GroveBoard, self).__init__()

        # pin mappings
        self.pin_mappings = PinMappings(joy_x_pin=2,
                                        joy_y_pin=3,
                                        step1_in1_pin=9,
                                        step1_in2_pin=10,
                                        step1_in3_pin=11,
                                        step1_in4_pin=12,
                                        step2_in1_pin=4,
                                        step2_in2_pin=5,
                                        step2_in3_pin=6,
                                        step2_in4_pin=7,
                                        i2c_bus=6)

        self.voltage = 1.0
        if HARDWARE_CONFIG.platform == KNOWN_PLATFORMS.firmata:
            addSubplatform(GENERIC_FIRMATA, "/dev/ttyACM0")
            self.pin_mappings += 512
            self.pin_mappings.i2c_bus = 512
            self.voltage = 1.33

        self.screen = Jhd1313m1(self.pin_mappings.i2c_bus, 0x3E, 0x62)
        self.joy = Joystick12(self.pin_mappings.joy_x_pin,
                              self.pin_mappings.joy_y_pin)

        self.step1 = ULN200XA(4096, self.pin_mappings.step1_in1_pin,
                              self.pin_mappings.step1_in2_pin,
                              self.pin_mappings.step1_in3_pin,
                              self.pin_mappings.step1_in4_pin)

        self.step2 = ULN200XA(4096, self.pin_mappings.step2_in1_pin,
                              self.pin_mappings.step2_in2_pin,
                              self.pin_mappings.step2_in3_pin,
                              self.pin_mappings.step2_in4_pin)
    def __init__(self):

        super(GroveBoard, self).__init__()

        # pin mappings
        self.pin_mappings = PinMappings(buzzer_pin=6,
                                        button_pin=5,
                                        rotary_pin=0,
                                        i2c_bus=6)

        if HARDWARE_CONFIG.platform == KNOWN_PLATFORMS.firmata:
            addSubplatform(GENERIC_FIRMATA, "/dev/ttyACM0")
            self.pin_mappings += 512
            self.pin_mappings.i2c_bus = 512

        self.screen = Jhd1313m1(self.pin_mappings.i2c_bus, 0x3E, 0x62)
        self.buzzer = Gpio(self.pin_mappings.buzzer_pin)
        self.rotary = Rotary(self.pin_mappings.rotary_pin)
        self.button = Button(self.pin_mappings.button_pin)

        self.buzzer.dir(DIR_OUT)

        self.rotary_value = 0
        self.button_state = False