<commit_before>#!/usr/bin/python

MOVE_MOTOR_PIN = 11
FORWARD_PIN = 13
BACKWARD_PIN = 15

TURN_MOTOR_PIN = 12
LEFT_PIN = 18
RIGHT_PIN = 16

#STEPPER_SECONDS = 1

PORT = 50007

#from time import sleep
import RPi.GPIO as GPIO
import socket
import sys

def init():
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(MOVE_MOTOR_PIN, GPIO.OUT)
    GPIO.setup(FORWARD_PIN, GPIO.OUT)
    GPIO.setup(BACKWARD_PIN, GPIO.OUT)
    GPIO.setup(TURN_MOTOR_PIN, GPIO.OUT)
    GPIO.setup(LEFT_PIN, GPIO.OUT)
    GPIO.setup(RIGHT_PIN, GPIO.OUT)

def done():
    GPIO.cleanup()

def stopAll():
    GPIO.output(FORWARD_PIN, False)
    GPIO.output(LEFT_PIN, False)
    GPIO.output(RIGHT_PIN, False)
    GPIO.output(BACKWARD_PIN, False)
    GPIO.output(TURN_MOTOR_PIN, False)
    GPIO.output(MOVE_MOTOR_PIN, False)

def enableMotor(movePin, directionPin, motorPin, turnPin):
    stopAll()
    print 'Move Pin {} and MotorPin {}'.format(movePin, motorPin)
#   print ' and Stepper {}'.format(STEPPER_SECONDS) 
    GPIO.output(motorPin, True)
    GPIO.output(turnPin, True)
    GPIO.output(movePin, True)
    GPIO.output(directionPin, True)
#    sleep(STEPPER_SECONDS)
#    GPIO.output(movePin, False)
#    GPIO.output(motorPin, False)
#    GPIO.output(directionPin, False)
#    GPIO.output(turnPin, False)

def evaluateDirection(userinput):
    if userinput=='vl':
        enableMotor(FORWARD_PIN, LEFT_PIN, MOVE_MOTOR_PIN, TURN_MOTOR_PIN)
    if userinput=='vr':
        enableMotor(FORWARD_PIN, RIGHT_PIN, MOVE_MOTOR_PIN, TURN_MOTOR_PIN)
    if userinput=='vv':
        enableMotor(FORWARD_PIN, FORWARD_PIN, MOVE_MOTOR_PIN, MOVE_MOTOR_PIN)
    if userinput=='zl':
        enableMotor(BACKWARD_PIN, LEFT_PIN, MOVE_MOTOR_PIN, TURN_MOTOR_PIN)
    if userinput=='zr':
        enableMotor(BACKWARD_PIN, RIGHT_PIN, MOVE_MOTOR_PIN, TURN_MOTOR_PIN)
    if userinput=='zz':
        enableMotor(BACKWARD_PIN, BACKWARD_PIN, MOVE_MOTOR_PIN, MOVE_MOTOR_PIN)
    if userinput=='s':<commit_msg>Logging corrections/extensions.<commit_after>#!/usr/bin/python

MOVE_MOTOR_PIN = 11
FORWARD_PIN = 13
BACKWARD_PIN = 15

TURN_MOTOR_PIN = 12
LEFT_PIN = 18
RIGHT_PIN = 16

#STEPPER_SECONDS = 1

PORT = 50007

#from time import sleep
import RPi.GPIO as GPIO
import socket
import sys

def init():
    GPIO.setmode(GPIO.BOARD)
    GPIO.setup(MOVE_MOTOR_PIN, GPIO.OUT)
    GPIO.setup(FORWARD_PIN, GPIO.OUT)
    GPIO.setup(BACKWARD_PIN, GPIO.OUT)
    GPIO.setup(TURN_MOTOR_PIN, GPIO.OUT)
    GPIO.setup(LEFT_PIN, GPIO.OUT)
    GPIO.setup(RIGHT_PIN, GPIO.OUT)

def done():
    GPIO.cleanup()

def stopAll():
    GPIO.output(FORWARD_PIN, False)
    GPIO.output(LEFT_PIN, False)
    GPIO.output(RIGHT_PIN, False)
    GPIO.output(BACKWARD_PIN, False)
    GPIO.output(TURN_MOTOR_PIN, False)
    GPIO.output(MOVE_MOTOR_PIN, False)

def enableMotor(movePin, directionPin, motorPin, turnPin):
    stopAll()
    print 'Pins: Move {} Direction {} Motor {} Turn {}'.format(movePin, directionPin, motorPin, turnPin)
#   print ' and Stepper {}'.format(STEPPER_SECONDS) 
    GPIO.output(motorPin, True)
    GPIO.output(turnPin, True)
    GPIO.output(movePin, True)
    GPIO.output(directionPin, True)
#    sleep(STEPPER_SECONDS)
#    GPIO.output(movePin, False)
#    GPIO.output(motorPin, False)
#    GPIO.output(directionPin, False)
#    GPIO.output(turnPin, False)

def evaluateDirection(userinput):
    if userinput=='vl':
        enableMotor(FORWARD_PIN, LEFT_PIN, MOVE_MOTOR_PIN, TURN_MOTOR_PIN)
    if userinput=='vr':
        enableMotor(FORWARD_PIN, RIGHT_PIN, MOVE_MOTOR_PIN, TURN_MOTOR_PIN)
    if userinput=='vv':
        enableMotor(FORWARD_PIN, FORWARD_PIN, MOVE_MOTOR_PIN, MOVE_MOTOR_PIN)
    if userinput=='zl':
        enableMotor(BACKWARD_PIN, LEFT_PIN, MOVE_MOTOR_PIN, TURN_MOTOR_PIN)
    if userinput=='zr':
        enableMotor(BACKWARD_PIN, RIGHT_PIN, MOVE_MOTOR_PIN, TURN_MOTOR_PIN)
    if userinput=='zz':
        enableMotor(BACKWARD_PIN, BACKWARD_PIN, MOVE_MOTOR_PIN, MOVE_MOTOR_PIN)
    if userinput=='s':
{'fraction_non_alphanumeric': 0.11442283404900228, 'fraction_numerical': 0.009093205354887599, 'mean_word_length': 4.301204819277109, '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': '4637289', 'n_tokens_mistral': 1626, 'n_tokens_neox': 1521, 'n_words': 273}