This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5
CONSULTA error al compilar exit status1 error al compilar tarjeta arduino uno
#1
no he podido compilarlo , desde ya muchas gracias por su tiempo

#include <LiquidCrystal.h>  // includes the LiquidCrystal Library
#include <math.h>    //para el redondeo
   
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);  // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)
// Connect panel using the standard lines.

// Sensor 1, trigger pin 13 y echo pin 12.
const int trigPin1 = 13;
const int echoPin1 = 12;

// Sensor 2, trigger pin 11 y echo pin 10.
const int trigPin2 = 11;
const int echoPin2 = 10;

// dimensiones Tanque 1 (el que esta en la parte inferior) en metros.
const float lengthBottomTankM = 3.2;
const float widthBottomTankM = 2;
const float deepBottomTankM = 1.7;
const float volTotalBottomTankM3 = 8.96;    // Restado 0.3 de distancia al sensor tanque inferior

// dimensiones Tanque 2 (el que esta en la parte inferior) en mestros
const float lengthUpTankM = 2.74;
const float widthUpTankM = 2;
const float deepUpTankM = 1.9;
const float volTotalUpTankM3 = 9.32;    // Restado 0.2 de distancia al sensor tanque superior
 
long duration1;
float deepBottomTankCm;

long duration2;
float deepUpTankCm;

float volumeBottomTank;
float volumeUpTank;

float porcBottomTank;
float porcUpTank;

void setup() {
  lcd.begin(16,2);  // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display
  pinMode(trigPin1, OUTPUT);
  pinMode(echoPin1, INPUT);
  pinMode(trigPin2, OUTPUT);
  pinMode(echoPin2, INPUT);
  Serial.begin (9600);   
}
 
void loop() {
// Trigger Lower tank
  digitalWrite(trigPin1, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin1, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin1, LOW);
  duration1 = pulseIn(echoPin1, HIGH);
  deepBottomTankCm= duration1*0.034/2;

// Trigger upper tank
  digitalWrite(trigPin2, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin2, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin2, LOW);
  duration2 = pulseIn(echoPin2, HIGH);
  deepUpTankCm= duration2*0.034/2;

if (deepBottomTankCm > 0 && deepUpTankCm > 0) {
// Make calculations based on volume1 and volume2
  volumeBottomTank = lengthBottomTankM * widthBottomTankM * (deepBottomTankM - (float)deepBottomTankCm/100);
     
  porcBottomTank = (float)volumeBottomTank/(float)volTotalBottomTankM3 * 100; 
 
  volumeBottomTank = round(volumeBottomTank*10);
  volumeBottomTank = volumeBottomTank/10;

  volumeUpTank = lengthUpTankM * widthUpTankM * (deepUpTankM - (float)deepUpTankCm/100);
  volumeUpTank = round(volumeUpTank*10);
  volumeUpTank = volumeUpTank/10;
  porcUpTank = (float)volumeUpTank / volTotalUpTankM3 * 100;

  Serial.println("cmBottom," + String(deepBottomTankCm) + ";
  cmUp," + String(deepUpTankCm));



// Show information on LCD
  lcd.setCursor(0,0);  // Sets the location at which subsequent text written to the LCD will be displayed
  lcd.println("S: " + String(volumeUpTank) + "m3, "+ String(round(porcUpTank)) + "%      ");  // Prints string "Distance" on the LCD
  lcd.println("DistaCm: " + String(deepUpTankCm) + "      ");
     
  delay(10);

  lcd.setCursor(0,1);
  lcd.println("I: " + String(volumeBottomTank) + "m3, "+ String(round(porcBottomTank)) + "%      ");
  lcd.println("DistCm: " + String(deepBottomTankCm) + "          ");
 
}
  delay(500);
}
  Responder
#2
Si además del código incluyes el error que te tira el IDE será más probable que alguien se lo mire.
Saludos
  Responder
#3
Buenos días

El problema lo tienes en tus líneas 81 y 82

Código:
Serial.println("cmBottom," + String(deepBottomTankCm) + ";

  cmUp," + String(deepUpTankCm));


Esas líneas las has copiado mal, y la primera línea le has puesto los dos puntos para cerrarla, pero la orden esta a medias, la orden correcta es

Código:
    Serial.println("cmBottom," + String(deepBottomTankCm) + "cmUp," + String(deepUpTankCm));

Y así si compila

Un saludo.
  Responder


Posibles temas similares…
Tema Autor Respuestas Vistas Último mensaje
  DUDA Envío de datos. Tarjeta feather 32u4 Okene 3 329 25-03-2022, 11:25 PM
Último mensaje: asesorplaza1
  Fusionar dos sketch en uno (código arduino) jgarridc 22 10,986 31-12-2018, 07:37 PM
Último mensaje: Surbyte
Pregunta [SOL] Tengo dos URL's en el mismo servidor en wordpress como redirigir de uno a otro Electromecánico 5 2,101 02-03-2018, 12:04 PM
Último mensaje: Electromecánico
  Problemas tarjeta de red Electromecánico 4 1,715 17-04-2015, 12:33 PM
Último mensaje: jumasape