<commit_before>'''
Authors: <NAME>, <NAME>

Original mcp3008 implementation completed by <NAME>.  Modularisation, extension for named pins and alternate bus addresses by <NAME>

This module implements support for use the TextStar Serial LCD display in TTL mode form the Raspberry Pi.  Supporting 16*2 charactor output and the builtin bar graph functionality.  For usage information please consult the examples distributed with this package.
'''

import sys

import spidev

class MCP3008(object):
    
    def __init__(self, spi_address_hardware=0, spi_address_output=0):
        self.spi = spidev.SpiDev()
        self.spi.open(spi_address_hardware, spi_address_output)
        self.inputs = { 0 : { 'name' : "pin_0"},
                        1 : { 'name' : "pin_1"},
                        2 : { 'name' : "pin_2"},
                        3 : { 'name' : "pin_3"},
                        4 : { 'name' : "pin_4"},
                        5 : { 'name' : "pin_5"},
                        6 : { 'name' : "pin_6"},
                        7 : { 'name' : "pin_7"},}
        
    # read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7)
    def read_input(self, source_pin):<commit_msg>Update ics/mcp3008.py<commit_after>'''
Authors: <NAME>, <NAME>

Original mcp3008 implementation completed by <NAME>.  Modularisation, extension for named pins and alternate bus addresses by <NAME>

This module implements support for the mcp3008 10bit Analogue to Digital convertor, allowing an analogue signal attached to one of the eight input pins to be translated into a corresponding value of between 0 and 1023.  For usage information please consult the examples distributed with this package.
'''

import sys

import spidev

class MCP3008(object):
    
    def __init__(self, spi_address_hardware=0, spi_address_output=0):
        self.spi = spidev.SpiDev()
        self.spi.open(spi_address_hardware, spi_address_output)
        self.inputs = { 0 : { 'name' : "pin_0"},
                        1 : { 'name' : "pin_1"},
                        2 : { 'name' : "pin_2"},
                        3 : { 'name' : "pin_3"},
                        4 : { 'name' : "pin_4"},
                        5 : { 'name' : "pin_5"},
                        6 : { 'name' : "pin_6"},
                        7 : { 'name' : "pin_7"},}
        
    # read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7)
    def read_input(self, source_pin):
{'fraction_non_alphanumeric': 0.10776218001651527, 'fraction_numerical': 0.03468208092485549, 'mean_word_length': 2.1714659685863875, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6908853', 'n_tokens_mistral': 762, 'n_tokens_neox': 700, 'n_words': 236}