Está en la página 1de 5

INSTITUTO TECNOLOGICO SUPERIOR DE

ESCARCEGA

INGENIERIA EN SISTEMAS COMPUTACIONALES

VI SEMESTRE

ING. CAROLINA NOVELO CAN

LENGUAJES Y AUTMATAS I

UNIDAD : 5

TAREA: PROPUESTA DE LENGUAJE

BR. LIZBETH PEREZ PEREZ


BR. GUSTAVO FELIX CHAN
BR. YOLANDA TORRES HUICAB
BR. JOSE ALEJANDRO TORRES
BR. JESUS OMAR ESCAYOLA CALDERN
BR. VERNICA ADRIANA HERNNDEZ ALMARO

BR. JESS JUREZ GONZLEZ

El proyecto integrador (sumobot), es un autmata finito que es programado en


Arduino por la placa que utiliza, la cual es Arduino Uno. Este utiliza un lenguaje
en comn, basado en C, para procesadores.
Definimos pruebas acerca de las acciones del sumobot y los estados en que
sea posible encontrarse en dichas situaciones, para no perder el juego.
Las estrategias a utilizar en el sumo fueron entregadas anteriormente, y de
stas formamos el cdigo en el lenguaje C para la programacin del
procesador ATMEGA8-16PU.

La estructura analizada quedara de la siguiente forma:


#include <stdio.h>
int main(void)
{
//llamar funciones:
iniciar();
}

return 0;

int iniciar(){ //funcin que inicia las acciones del sumo


return 0;
}
int acelerarServoIzq(int grados){
return grados;
//avanza por grados a la izquierda
}
int acelerarServoDerecha(int grados){
return grados; //avanza por grados a la derecha
}
int acelerarServoAdelante(int grados){
return grados;
//avanza hacia adelante
}
int acelerarServoAtras(int grados){
return grados;
//avanza hacia atrs
}

- - - - - - - - - - - - - - -- - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #include <ZumoMotors.h>
/*
* This example uses the ZumoMotors library to drive each motor on the
Zumo
* forward, then backward. The yellow user LED is on when a motor
should be

* running forward and off when a motor should be running backward. If


a

* motor on your Zumo has been flipped, you can correct its direction
by
* uncommenting the call to flipLeftMotor() or flipRightMotor() in the
setup()
* function.
*/
#define LED_PIN 13
ZumoMotors motors;
void setup()
{
pinMode(LED_PIN, OUTPUT);
// uncomment one or both of the following lines if your motors'
directions need to be flipped
//motors.flipLeftMotor(true);
//motors.flipRightMotor(true);
}
void loop()
{
// run left motor forward
digitalWrite(LED_PIN, HIGH);
for (int speed = 0; speed <= 400; speed++)
{
motors.setLeftSpeed(speed);
delay(2);
}
for (int speed = 400; speed >= 0; speed--)
{
motors.setLeftSpeed(speed);
delay(2);
}
// run left motor backward
digitalWrite(LED_PIN, LOW);
for (int speed = 0; speed >= -400; speed--)
{
motors.setLeftSpeed(speed);
delay(2);
}
for (int speed = -400; speed <= 0; speed++)
{
motors.setLeftSpeed(speed);
delay(2);
}
// run right motor forward
digitalWrite(LED_PIN, HIGH);

for (int speed = 0; speed <= 400; speed++)


{
motors.setRightSpeed(speed);
delay(2);
}
for (int speed = 400; speed >= 0; speed--)
{
motors.setRightSpeed(speed);
delay(2);
}
// run right motor backward
digitalWrite(LED_PIN, LOW);
for (int speed = 0; speed >= -400; speed--)
{
motors.setRightSpeed(speed);
delay(2);
}
for (int speed = -400; speed <= 0; speed++)
{
motors.setRightSpeed(speed);
delay(2);
}
delay(500);

También podría gustarte