Paste
Copy
Cut
Options

¡Tu solución está lista!

Nuestra ayuda de expertos desglosó tu problema en una solución confiable y fácil de entender.

Mira la respuesta
  • Pregunta: Your exercise consists of programming an elevator with the following requirements (for now, when you read the description, imagine the elevator that takes you to the mechanical department, but you will have the following restrictions/characteristics- consists of 3 floors in total- a servo motor to control which floor it is



    Your exercise consists of programming an elevator with the following requirements (for now, when you read the description, imagine the elevator that takes you to the mechanical department, but you will have the following restrictions/characteristics

    - consists of 3 floors in total

    - a servo motor to control which floor it is on. assume 0, 90 and 180 degrees to go to floors 1 to 3 respectively

    - each floor has a sensor (it can be a limit switch, that is, it counts as a pushbutton), which indicates when the elevator passes through a floor or

    If you are detained there on that floor

    - on each floor, on the outside, there is only one button, to call it (imagine that you are waiting for the elevator on the mechanical floor for example)

    - inside the elevator, there are 3 buttons, one for each floor

    In total, it has 9 pushbuttons (3 inside the elevator to say where it is going, and 3 outside one on each floor to call it, plus 3 that simulate the sensors that indicate which floor it is on). It has 1 PWM output, servo motor

    - only the operation of one floor at a time will be worked, that is, once one of the three buttons is pressed, the engine begins to work (if necessary) until it reaches that floor. completely ignore other buttons until it has not reached the requested floor. one at a time (there is no memory that keeps that multiple floors were pressed for example

    - you should keep in mind that if the elevator is already on the requested floor, it should not move. For example, if it is on the 1st floor and the button on the 1st floor is pressed, the system does nothing

    - remember that if you are on floor 1, you can only go up, called by button 2 or 3, you must go up. if you are on floor 3, you can only go down, called by button 2 or 1, down. if you are on floor 2, you can go up or down depending on who is activated (button 3 makes it move up, button 1 makes it move down

    Recommendation, an IF for each floor or an IF with multiple elseif, one for each floor.

    Recommendation, use more than one condition at a time, AND/OR. for example, if P1 inside or P1 outside were activated, go to floor 1 (serve the position O degrees)


    student submitted image, transcription available below
    Muestra el texto de la transcripción de la imagen
  • Chegg Logo
    Hay 3 pasos para resolver este problema.
    Solución
    Paso 1

    El ejercicio consiste en programar un elevador que consta de 3 pisos en total, y para controlarlo se ...

    Mira la respuesta completa
    answer image blur
    Paso 2
    Desbloquea
    Paso 3
    Desbloquea
    Respuesta
    Desbloquea
Texto de la transcripción de la imagen:
Su ejercicio consisto en programar un elevador con los siguientes requisitos (por ahora, cuando lea la doscripcion, imaginese el elevador que los lleva al departamento de mecanica, pero tendra las siguientes restricciones/caracteristicas) - consta de 3 pisos on total - un motor servo para controlar en que piso esta. asuma 0,90 y 180 grados para ir a los pisos 1 al 3 respectivamento - cada piso tieno un sensor (puedo sor limit switch, es decir, cuenta como pushbutton), que indica cuando ol elevador paso por algun piso o si esta detenido alli en ese piso - en cada piso, on la parte do afuera, hay un solo boton, para llamarlo (imagineso que osta ustod osperando el olevador on ol piso de mocanica por ejemplo) - dentro del elevador, hay 3 botones, uno para cada piso en total, tiene 9 pushbuttons ( 3 por dentro del elevador para decir hacia dondo va, y 3 por fuera uno en cada piso para llamarlo, mas 3 que simulan los sensores que indican en que piso se encuentra), tiene 1 salida PWM, motor servo. - se trabajara solo el funcionamionto do un piso a la vez, es decir, una vez se presione uno de los tres botones, el motor empieza a trabajar (si es que es necesario) hasta que llegue a ese piso. ignorara por completo otros botones hasta que no haya llegado al piso pedido. uno a la vez (no hay memoria que guarde que se presionaron multiples pisos por cjemplo) - debe tener en cuenta que si el elevador ya se encuentra en el piso pedido, no debe moverse, por ojomplo, si esta en el piso 1 y so prosiona el boton del piso 1 , al sistema no hace nada - rocuerde que si esta en el piso 1, solo puede subir, llamado por boton 203 , debe ir hacia arriba, si osta en piso 3 , solo puedo bajar, llamado por boton 2 o 1, hacia abajo. si esta en el piso 2, puede subir o bajar dependiendo de quien se active (boton 3 hace que se mueva hacia arriba, boton 1 hace que se mueva hacia abajo) recomendacion, un IF para cada piso o un IF con multiplos olseif, uno para cada piso. recomendacion, use mas de una condiciona a la vez, ANDIOR, por ejemplo, si P1adentro O P1afuera fueron accionados, ir a piso 1 (servo a la posicion 0 grados)