HTML icon

1.5.4JacobHoward.c no repeat()

HTML | PRO | 03/11/19 06:00:18 PM UTC | 0 ⭐ | 431 👁️ | Never ⏰ | []
C |

11.12 KB

|

None

|

0 👍

/

0 👎

#pragma config(Sensor, dgtl1,  limitSwitch,    sensorTouch)
#pragma config(Motor,  port2,           leftMotor,     tmotorVex393_MC29, openLoop)
#pragma config(Motor,  port4,            ,             tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
 
 
/*
  Project Title: 1.5.4
  Team Members: Jacob H, Joshua R, Gabriel J
  Date: 3-8-19
  Section:
 
 
  Task Description:oscilate gear in both directions a total of 20 times
 
 
  Pseudocode:
 
*/
 
 
task main()
{
/*
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, 63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    startMotor(leftMotor, -63); // Start motor
    wait(.5); // Wait .5 seconds before proceeding
    stopMotor(leftMotor); // End program
*/
// 4: This is a open loop system; the loop will continue until time stops it, no external input is required
// 5: In relatively the same location, it doesn't have much reason to change logiaclly.
/*
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
    untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
    startMotor(leftMotor, 63); // Start motor in the clockwise direction
    wait(.5); // Proceed to spin in clockwise direction for .5 seconds
    stopMotor(leftMotor); // End program
*/
// 10: This is a closed loop system; external sensor input is required to continue and eventually end the program
// 11: The gear assembly should, like the last program, end in the same location since it will be instructed to change direction at the same point every time
// 12: If the program is meant to run constantly, it should not be instructed to stop by non-emergency external sensor input
 
/*
     1: An example of an open loop system could be a wind turbine, since this would only be stopped by the event of no wind.
     2: An example of a closed loop system may be a light switch, since the light will continue to operate until shut off manually.
*/
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎