Go to Post We don't want "The Flame Heard 'Round the World"... - Andrew Blair [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 01-19-2015, 06:12 PM
curtis0gj curtis0gj is offline
Registered User
FRC #5033 (Beavertronics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Canada
Posts: 121
curtis0gj will become famous soon enough
Unhappy Autonomous Help

Hey all, newbie programmer here looking for some help with my autonomous code. At the moment I need to be able to turn 90 on the spot using a gyro stop and drive straight also using a gyro and encoder for distance.

Code:
public void autonomous() {
    	
    	while(isAutonomous() && isEnabled())  {
    		
    		SmartDashboard.putNumber("angle", gyro1.getAngle());
    		
    		double angle = gyro1.getAngle();
    		
    		robot.drive(-0.20, 1);
    		
    		if(angle > 83) {
    			
    			robot.drive(0,0);
    			
    			break;
The issue I have is the robot won't stop turning . I need a basic tutorial on setting up an encoder for distance. Also if anyone could show me how I could start driving straight after this turn, Thanks for the help.
Reply With Quote
 


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:08 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