View Single Post
  #2   Spotlight this post!  
Unread 11-01-2017, 22:06
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 144
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
Re: What is the replacement method for initDigitalPort?

Quote:
Originally Posted by niwhsa9 View Post
I've come into a little problem with some legacy code from the 2016 control system. I'm trying to control the adis16448 board with this library
which compiled fine in the 2016 wpilibj, but doesn't compile in the 2017 version. Now, I'd like to get this up and running quickly without having to wait for the dev to update, and there are actually only two errors.
Relevant code here:
Code:
private static class InterruptSource extends DigitalSource {
    public InterruptSource(int channel) {
      initDigitalPort(channel, true);
    }
  }
First is that the InterruptSource class has some unimplemented methods from the parent class. I just added empty definitions for these and that error obviously went away. Next is that the method initDigitalPort is not defined from the parent class. This is the part that I get stuck on. Upon examination of the API Javadoc, the Source Code on github, and the context of this code, I still can't seem to figure out what this does or how to fix it. I'm guessing this has been depreciated in the 2017 wpilibj library.

My question is, what is the replacement method for initDigitalPort?

Forgive me for anything simple I've overlooked, we are a new FRC team so we have 0 experience with using wpilibj.

Also, it might help if I understood what the DigitalSource class actually does, could someone explain this to me?

Thanks, help is greatly apreciated!
I opened a pull request to fix this issue. If you want to fix it yourself, take a look at the diff here: https://github.com/juchong/ADIS16448.../pull/10/files
__________________
Reply With Quote