Go to Post Every robot is a key element to each victory, no matter how much or how little they help. - JosephC [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-19-2016, 02:38 PM
gofmannir gofmannir is offline
Registered User
AKA: Nir Gofman
FRC #2096 (RoboActive)
Team Role: Programmer
 
Join Date: Nov 2015
Rookie Year: 2015
Location: Israel
Posts: 11
gofmannir is an unknown quantity at this point
How to do two actions on the same time?

Hello
How I can program that two motors (for example) move at the same time...
In the autonomous I'm using the set() method and after that the delay() and that again set() to stop the motor..
How can I move two motors on the same time?
Reply With Quote
  #2   Spotlight this post!  
Unread 02-19-2016, 04:54 PM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: How to do two actions on the same time?

If I understand you correctly, you have something like:
Code:
motor1.set(1.0);
wait(3.0);
motor1.set(0.0);
To control two motors at the same time, you can just do:
Code:
motor1.set(1.0);
motor2.set(1.0);
wait(3.0);
motor1.set(0.0);
motor2.set(0.0);
__________________
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:59 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi