1 / 9

Programming - Buttons

Programming - Buttons. Ch 5-8. Joysticks work by moving the stick along an axis and thus any value between 127 & -127 can be sent. With the buttons they are either pushed or not pushed. So only SPECIFIC values can be sent. Pressed or NOT pressed.

velvet
Download Presentation

Programming - Buttons

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming - Buttons

  2. Ch 5-8 Joysticks work by moving the stick along an axis and thus any value between 127 & -127 can be sent. With the buttons they are either pushed or not pushed. So only SPECIFIC values can be sent.

  3. Pressed or NOT pressed A pressed value will send a value of “1”, while returning “0” when NOT pressed.

  4. Programming the Button

  5. Mine Field Challenge – Time Periods The challenge itself is 2 minutes or 120 seconds. There are 3 periods of time. • Period 1 = 30 sec Autonomous Period • Period 2 = Idle Period (gives the judges a chance to tally up the points made during period 1) • Period 3 = 90 sec User Control Period

  6. Fear of Disqualification? You added the wait1Msec( ) command in the beginning of the code to give you a chance to move out of the way before commands are given. But what happens if you accidentally touch the joystick in between Period 2 and 3? Or what happens if the signal is given BEFORE your timer runs out?

  7. Idle Loop So that you can sit and wait for a judge’s signal and NOT use up the 90 sec for the User control period we create what is called an IDLE LOOP. What this says is that as long as the Channel 8 “UP” registers zero (meaning it is NOT pressed), then DO NOTHING).

  8. Your program should look like this Make sure you SAVE this file in you’re MY DOCUMENTS folder as MINE CONTROL.

  9. Partnering You have the ability to add a SECOND user by simply connecting 2 Cortex controllers with a phone cord cable. Names for the second remote control are appended by “Xmtr2”. For example, to access the Ch 8 “up” button on the second remote control, the command would be: vexRT[Btn8UXmtr2]

More Related