<commit_before>## sensor

import RPi.GPIO as GPIO
import time
import serial

syrus = serial.Serial('/dev/ttyUSB0',baudrate=115200)
def medidas():
    GPIO.setmode(GPIO.BCM)

    TRIG = 8
    ECHO = 7

    print "Distance Measurement In Progress"

    GPIO.setup(TRIG,GPIO.OUT)
    GPIO.setup(ECHO,GPIO.IN)
    itera = raw_input("numero de iteraciones: ")

    
    GPIO.output(TRIG, False)
    print "Esperando distancia.."
    print " "
    time.sleep(2)
    GPIO.output(TRIG, True)
    time.sleep(0.00001)
    GPIO.output(TRIG, False)
    while GPIO.input(ECHO)==0:
        pulse_start = time.time()
        
    while GPIO.input(ECHO)==1:
        pulse_end = time.time()
        
    pulse_duration = pulse_end - pulse_start

    distance = pulse_duration * 17150

    distance = round(distance, 2)## redondea el valor

    print "Distance:",distance,"cm"
    return distance
    GPIO.cleanup()

while true:
    m = medindas()
    #syrus.write(m)
    print(m)
    time.sleep(0.5)

<commit_msg>solo rasp<commit_after>
## sensor

import RPi.GPIO as GPIO
import time
import serial

#syrus = serial.Serial('/dev/ttyUSB0',baudrate=115200)
def medidas():
    GPIO.setmode(GPIO.BCM)

    TRIG = 2
    ECHO = 3

    print "Distance Measurement In Progress"

    GPIO.setup(TRIG,GPIO.OUT)
    GPIO.setup(ECHO,GPIO.IN)


    GPIO.output(TRIG, False)
    print "Esperando distancia.."
    print " "
    time.sleep(2)
    GPIO.output(TRIG, True)
    time.sleep(0.00001)
    GPIO.output(TRIG, False)
    while GPIO.input(ECHO)==0:
        pulse_start = time.time()

    while GPIO.input(ECHO)==1:
        pulse_end = time.time()

    pulse_duration = pulse_end - pulse_start

    distance = pulse_duration * 17150

    distance = round(distance, 2)## redondea el valor

    print "Distance:",distance,"cm"
    return distance
    GPIO.cleanup()

while True:
    m = medidas()
    #syrus.write(m)
    print(m)
    time.sleep(0.5)



{'fraction_non_alphanumeric': 0.12441436751691827, 'fraction_numerical': 0.02706923477355544, 'mean_word_length': 2.7392996108949417, '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': '6142034', 'n_tokens_mistral': 735, 'n_tokens_neox': 671, 'n_words': 145}