Log in

View Full Version : no suitable constructor found error?


Bennett
06-02-2012, 08:33
Ok so i'm coding the Accelerometer, and in my commandbase i have public static Accelerometer Accelerometer = new Accelerometer();
and no matter what we try we always get the error: no suitable constructor found for Accelerometer()
any help would be appreciated, thanks.

notmattlythgoe
06-02-2012, 08:34
It needs a channel number, wherever it is plugged in.
public static Accelerometer Accelerometer = new Accelerometer(1);

Here is a link to the Javadoc for it.
http://www.wbrobotics.com/javadoc/edu/wpi/first/wpilibj/Accelerometer.html

Bennett
06-02-2012, 09:30
ok that worked, thanks!