Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
VEX Robotics I Power Points                             Topic 09                    Programming Design Basics             ...
Program sketch 3 – have your robot run through                            the subroutine and stop after it makes 5        ...
Program sketch 3 – have your robot run through                          the subroutine and stop after it makes 5          ...
WHILE loops canrun for a certainnumber of cycles    by using   variables
WHILE loops can    run for a certain                                Using Variables    number of cycles        by using   ...
Program sketch 3 – have your robot run through                          the subroutine and stop after it makes 5          ...
Change your code and test your robotReport to your teacher for your individual programming challenge
Upcoming SlideShare
Loading in …5
×

Programming with sensors bumper switch 3

4,677 views

Published on

  • Be the first to comment

  • Be the first to like this

Programming with sensors bumper switch 3

  1. 1. VEX Robotics I Power Points Topic 09 Programming Design Basics Bumper Switch Sensing 3www.pedagogics.ca
  2. 2. Program sketch 3 – have your robot run through the subroutine and stop after it makes 5 START contacts with the wall What needs to change? IF TRUE Switch TRUE WHILE DRIVEFALSE not t < 60 s pressed FORWARD ? STOP MOTORS FALSE Stop, reverse, 180 END degree turn
  3. 3. Program sketch 3 – have your robot run through the subroutine and stop after it makes 5 START contacts with the wall IF WHILE TRUE sensor TRUE Switch DRIVEFALSE not count pressed FORWARD <5 ? STOP MOTORS FALSE Stop, reverse, 180 END degree turn
  4. 4. WHILE loops canrun for a certainnumber of cycles by using variables
  5. 5. WHILE loops can run for a certain Using Variables number of cycles by using Any term (except for reserved words) can variables be used as a variable in ROBOTCAn integer variable is used to keep track of a number of events etc.Each time the bumper is activated, we want the counter to increase by 1
  6. 6. Program sketch 3 – have your robot run through the subroutine and stop after it makes 5 START contacts with the wall What needs to change? IF WHILE TRUE sensor TRUE Switch DRIVEFALSE not count pressed FORWARD <5 ? STOP MOTORS FALSE Stop, reverse, 180 Counter + 1 END degree turn
  7. 7. Change your code and test your robotReport to your teacher for your individual programming challenge

×