Go to Post but you can rest assured: I have restored the balance by letting the GDC know that I know that they know that you know they have a pattern. -Leav - Leav [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
  #11   Spotlight this post!  
Unread 01-27-2015, 04:01 PM
acastagna acastagna is offline
Registered User
FRC #1493
 
Join Date: Jan 2012
Location: Albany High School
Posts: 28
acastagna is an unknown quantity at this point
Re: Gyro class issue?

Here's the code now. Still nothing. If I uncomment out the ai1.getVoltage I still get what looks like the proper voltage.



Code:
import edu.wpi.first.wpilibj.smartdashboard.*;
 import edu.wpi.first.wpilibj.Gyro
 import edu.wpi.first.wpilibj.AnalogInput

 public class Robot extends IterativeRobot
 {

   AnalogInput ai1 = new AnalogInput(0);
   Gyro gyro = new gyro(ai1);
 
    double angle1, voltage1;

    public void robotInit()
 {
    gyro.initGyro();
    gyro.reset();
    gyro.setSensitivity(0.007);
 }

 public void autnoomousPeriodic()
 {
 }

 public void teleopPeriodic()
 {
    angle1 = gyro.getAngle();
    // voltage1 = ai1.getAverageVoltage();
    SmartDashboard.putString("DB/String 6","gyro = "+angle1);
 }
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:13 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