Accelerometer (4 pin) with Java

We’ve looked at this for an hour and can’t figure out for the life of me how to wire and program the 2013 accelerometer. Is it digital or analog? Which pins go where? How do I instantiate it in java (and get input)?

As for wiring it. It uses I2C (I squared C). The I2C port on the Digital Sidecar is located behind the Phone-like jack (Which is also an I2C jack for use with Certain sensors), as seen in the image below. (Note: ONLY the one closest to the phone-like port is I2C, the other 4 pins next to that are not).

http://frc-labs.com/wp-content/uploads/2012/03/am-0866-211.jpg

For programming I will refer you to the code we used this year. We use it in a PID loop for use in Leveling our robot during climbing.

Subsystem:
ClimbingMotor

Command:
LevelDuringClimb

Forgive any roughness in this code, it was done by our newer programmers. Any other questions, please ask away!