Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Encoder questions - using DIO ports (http://www.chiefdelphi.com/forums/showthread.php?t=154153)

FRCTeam2906 23-01-2017 21:34

Encoder questions - using DIO ports
 
We are attempting to use different encoders through the DIO ports on our roboRIO for both our teleop and auto programs. We have never used these in the past. When we run our code the motor runs without stopping once it reaches the set value. Any help or examples are appreciated.

Thank you,
Team 2906

acastagna 23-01-2017 21:44

Re: Encoder questions - using DIO ports
 
It sounds like you are not setting your motor input back to zero when the target has been reached. You would need to post your code to say for sure.

david.e.boles 24-01-2017 14:00

Re: Encoder questions - using DIO ports
 
Agreed, assuming you can tell that the encoders are working and being read properly. Code?

FRCTeam2906 28-01-2017 23:53

Re: Encoder questions - using DIO ports
 
We have attempted to print the encoder values to the drivers station but they always return as 0, does bot matter if the motor is running or not.

Link to code: https://github.com/FRC2906/Practice

Please take a look and see what you can find asap!

Joe Ross 29-01-2017 09:05

Re: Encoder questions - using DIO ports
 
I don't see where you are outputting the encoder value, at first glance

FRCTeam2906 29-01-2017 13:45

Re: Encoder questions - using DIO ports
 
I believe that is located on line 136 and 142 of our robot map

Joe Ross 29-01-2017 15:37

Quote:

Originally Posted by FRCTeam2906 (Post 1637791)
I believe that is located on line 136 and 142 of our robot map



Robot Map is only called once. You should output the data in something called periodically, like a command.

FRCTeam2906 30-01-2017 10:23

Re: Encoder questions - using DIO ports
 
Ok thanks. So now we can see the values in the smart dashboard but how do we use it? If we want to run an auto command that does something like: "drive strait until the encoder value is gresater than 1000. What would it look like? A while, if or something else?

wlogeais 30-01-2017 11:52

Re: Encoder questions - using DIO ports
 
Take a look at File -> new -> Example Robot projects... -> GearsBot.

The relevant code is within the ...team...commands package, namely DriveStraight.java and the team-subsystem methods added to support it.

Joey1939 30-01-2017 12:10

Re: Encoder questions - using DIO ports
 
Relevant PSA: https://github.com/Open-RIO/.gitignore

bobbysq 30-01-2017 13:36

Re: Encoder questions - using DIO ports
 
Quote:

Originally Posted by Joey1939 (Post 1638113)

Please. It'll keep the size of the repo down, and it'll make committing and pushing take a shorter amount of time since there's not as much to move over.

Unlike that gitignore though, we do keep our IDE files so it's easier to import into other Eclipse instances.


All times are GMT -5. The time now is 21:52.

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