 #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 30 18:14:35 2019

@author: moetom

"""

import time
import board
import busio
import adafruit_mpr121
import mod

i2c = busio.I2C(board.SCL, board.SDA)
mpr121 = adafruit_mpr121.MPR121(i2c)


while True:
    for sensor in range(7):
        if mpr121[sensor].value:
            """ Checks which sensorimput got an value """
            if sensor < 6:
                mod.gemuese.gemList[sensor].Play(mod.switch.activMode)           
                if mod.switch.modeList[mod.switch.activMode] != mod.switch.drums:    # only drums need a very short gap
                   time.sleep(mod.gemuese.gemList[sensor].sleepTime)
                else:
                    time.sleep(0.2)   
            else:
                mod.switch.NextMode()
                time.sleep(1)
                

