Our code uses Rev Robtics' version of WPILib's Swerve code. Since WPI allows for ainimum of two swerve modules, we can get away with using only 2. in theory, one could use three as well, but we have not attempted such things as of yet.
You can find out code on GitHub.