<commit_before>'''
Created on 06.01.2015

@author: kinders
'''

try:
    import RPi.GPIO as GPIO
except ImportError:
    from pytrain.GPIOStub import GPIO
  
class Backend(object):
    '''
    classdocs
    '''
    def __init__(self):
        '''
        Constructor
        '''
        self.switchState = [ 0,0,0,0,0,0,0,0,0 ]
        # GPIO PIN numbers of the switches
        # first is the 8-port breakout board, second the 4-port breakout board
        GPIO.setmode(GPIO.BOARD)
        self.gpioMap = [ 3,5,7,11,13,15,19,21,  14,15,18,23 ]
        for pinid in self.gpioMap:
            GPIO.output(pinid,0);
        
    def toggleSwitch(self,i):
        pinid = self.gpioMap[i]
        self.switchState[i] = 1-self.switchState[i]
        print("switched number [",i,"], pinid [",pinid,"] new state is ",self.switchState)
        GPIO.output(pinid,self.switchState[i]);
        <commit_msg>Fixed port assignments, initialize output pins<commit_after>'''
Created on 06.01.2015

@author: kinders
'''

try:
    import RPi.GPIO as GPIO
except ImportError:
    from pytrain.GPIOStub import GPIO
  
class Backend(object):
    '''
    classdocs
    '''
    def __init__(self):
        '''
        Constructor
        '''
        self.switchState = [ 0,0,0,0,0,0,0,0,0 ]
        # GPIO PIN numbers of the switches
        # first is the 8-port breakout board, second the 4-port breakout board
        GPIO.setmode(GPIO.BOARD)
        self.gpioMap = [ 3,5,7,11,13,15,19,21,  10,12,16,18 ]
        for pinid in self.gpioMap:
            print("Initializing PIN ",pinid)
            GPIO.setup(pinid,GPIO.OUT)
            GPIO.output(pinid,0);
        
    def toggleSwitch(self,i):
        pinid = self.gpioMap[i]
        self.switchState[i] = 1-self.switchState[i]
        print("switched number [",i,"], pinid [",pinid,"] new state is ",self.switchState)
        GPIO.output(pinid,self.switchState[i]);
        
{'fraction_non_alphanumeric': 0.13253012048192772, 'fraction_numerical': 0.044002095337873234, 'mean_word_length': 2.339160839160839, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7354632', 'n_tokens_mistral': 685, 'n_tokens_neox': 640, 'n_words': 143}