error "does not name a type" is for school... please help

al momento de compilar me salen estos errores... tengo buscando ya 2 horas y no encuentro nada, son varios errores si pudieran ayudarme.... el programa usa un acelerometro para regular la velocidad de 3 motores.. gracias por su ayuda

at the time of compiling I get these errors ... I have been looking for 2 hours and I can not find anything, they are several errors if they could help me .... the program uses an accelerometer to regulate the speed of 3 engines .. thanks for your help

#include <Adafruit_ADXL345_U.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
#include <SPI.h>
#include <AFMotor.h>

ADXL345 adxl = ADXL345();
AF_DCMotor Mabajo(1);
AF_DCMotor Marriba(2);
AF_DCMotor Matras(3);
int x,y,z;
int velocidad=0;
int boton=11;
int estado=0;
int const Amax=1200;

void setup() {
Serial.begin(9600);
adxl.powerOn();
adxl.setRangeSetting(16);
Matras.setSpeed(100);
}

void loop() {
adxl.readAccel(&x, &y, &z);
Serial.print(x);
Serial.print(", ");
Serial.print(y);
Serial.print(", ");
Serial.println(z);

if(!digitalRead(boton)){
switch(estado){
case 0:
Encendido();
estado=1;
break;
case 1:
Apagado();
estado=0;
break;
}
}
}
int Helices(){
Mabajo.setSpeed(velocidad);
Marriba.setSpeed(velocidad);
Mabajo.run(FORWARD);
Marriba.run(BACKWARD);
}
int Rotar1(){
Matras.run(FORWARD);
}
int Rotar2(){
Matras.run(BACKWARD);
}
int Encendido(){
while(y<Amax){
velocidad=velocidad+5;
Helices();
}
while(y>=Amax){
Rotar1();
delay(5000);
Rotar2();
delay(5000);
}
}
int Apagado(){
while(y>0){
velocidad=velocidad-5;
Helices();
}
}

errors------------------------------

Arduino:1.8.5 (Windows Store 1.8.10.0) (Windows 10), Tarjeta:"Arduino/Genuino Uno"

Helicoptero:9: error: 'ADXL345' does not name a type

ADXL345 adxl = ADXL345();

^

C:\Users\MANUEL\Downloads\Helicoptero\Helicoptero.ino: In function 'void setup()':

Helicoptero:21: error: 'adxl' was not declared in this scope

adxl.powerOn();

^

C:\Users\MANUEL\Downloads\Helicoptero\Helicoptero.ino: In function 'void loop()':

Helicoptero:27: error: 'adxl' was not declared in this scope

adxl.readAccel(&x, &y, &z);

^

exit status 1
'ADXL345' does not name a type

Este reporte podría tener más información con
"Mostrar salida detallada durante la compilación"
opción habilitada en Archivo -> Preferencias.

DON'T CROSS POST!!!!!!!!!!!!!!!!!!!!
http://forum.arduino.cc/index.php?topic=535521
I HAVE REPORTED THIS THREAD TO THE MODERATORS

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]``[color=blue]// your code is here[/color]``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

When your code requires a library that's not included with the Arduino IDE please always post a link (using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

sorry i am new.... :confused:

That's no excuse. That's why we try to help new members with the big fat sticky at the op of each board called How to use the forum. Now please edit your post like pert said. That would make it a lot more clear :slight_smile:

Try looking at the example sketch that came with the library (hint look in the Examples sub-menu of the Files menu).

Do you see any differences in how the sensor object is defined?

Ian

Moderator removed cross post.