Computers, Development Boards & Shields
Educational & Robotics Kits
Electronic Sensors
Motors & Controllers
Communication & Display
Electronic Components
Soldering & Lab Tools

Getting error: ‘Accelerometer’ does not name a type

When I try to run the calibration code from the Virtuabotix Accelerometer library I keep getting this error and can’t seem to fix it.

In file included from autoCalibration.ino:15:
C:UsersADMINDocumentsArduinolibrariesAQ_Accelerometer/Accelerometer.h:25:27: error: GlobalDefined.h: No such file or directory
autoCalibration:17: error: ‘Accelerometer’ does not name a type
autoCalibration.ino: In function ‘void setup()’:
autoCalibration:25: error: ‘myAccelerometer’ was not declared in this scope
autoCalibration.ino: In function ‘void loop()’:
autoCalibration:37: error: ‘myAccelerometer’ was not declared in this scope

1 Answer


The error code ‘Accelerometer’ does not name a type always means that the library is either not installed corretly, or that you did not add an appropriate #include statement for it.


This applies to any Arduino Library, not just the Accelerometer library.  Here are a couple of things to check to make sure you installed the library correctly:

Is the ENTIRE library folder moved into the “libraries” directory? (on mac os and linux you must create a “libraries” directory in your sketches folder).

Is the name of the folder just “Accelerometer” be sure to remove any trailing text from the directory name, the folder name should match the main .h and .cpp files.

Is the library inside a sub-directory? Make sure you don’t have an Accelerometer folder that has and Accelerometer folder inside it, because that would confuse the poor Arduino IDE very badly.

If you are still having trouble after that please post the specific issue you are having, and the details of your library installation (this applies to anyone reading this)



Joseph Dattilo
Founder Virtuabotix LLC

Your Answer

No comments yet.

Leave a Reply