HTML

1.5.4JacobHoward.c

Mar 11th, 2019
324
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.24 KB | None | 0 0
  1. #pragma config(Sensor, dgtl1,  limitSwitch,    sensorTouch)
  2. #pragma config(Motor,  port2,           leftMotor,     tmotorVex393_MC29, openLoop)
  3. #pragma config(Motor,  port4,            ,             tmotorVex393_MC29, openLoop)
  4. //*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
  5.  
  6.  
  7. /*
  8.   Project Title: 1.5.4
  9.   Team Members: Jacob H, Joshua R, Gabriel J
  10.   Date: 3-8-19
  11.   Section:
  12.  
  13.  
  14.   Task Description:oscilate gear in both directions a total of 20 times
  15.  
  16.  
  17.   Pseudocode:
  18.  
  19. */
  20.  
  21.  
  22. task main()
  23. {
  24. /*
  25.     repeat(20) // Code in the brackets below will be repeated 20 times before proceeding to the stopMotor command
  26.     {
  27.     startMotor(leftMotor, 63); // Start motor
  28.     wait(.5); // Wait .5 seconds before proceeding
  29.     startMotor(leftMotor, -63); // Start motor
  30.     wait(.5); // Wait .5 seconds before proceeding
  31.     }
  32.     stopMotor(leftMotor); // End program
  33. */
  34. // 4: This is a open loop system; the loop will continue until time stops it, no external input is required
  35. // 5: In relatively the same location, it doesn't have much reason to change logiaclly.
  36. /*
  37.     repeat(20) // Code in the brackets below will be repeated 20 times before proceeding to the stopMotor command
  38.     {
  39.     startMotor(leftMotor, -63); // Start motor in the counterclockwise direction
  40.     untilBump(limitSwitch); // Proceed to spin counterclockwise until switch is activated
  41.     startMotor(leftMotor, 63); // Start motor in the clockwise direction
  42.     wait(.5); // Proceed to spin in clockwise direction for .5 seconds (loop back to start until 20 repetitions have occurred)
  43.     }
  44.     stopMotor(leftMotor); // End program
  45. */
  46. // 10: This is a closed loop system; external sensor input is required to continue and eventually end the program
  47. // 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
  48. // 12: If the program is meant to run constantly, it should not be instructed to stop by non-emergency external sensor input
  49.  
  50. /*
  51.      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.
  52.      2: An example of a closed loop system may be a light switch, since the light will continue to operate until shut off manually.
  53. */
  54. }
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment