Error compiling for board arduino uno - Airflow, Humidity, Particulate Matter Seonsors

Hey y'all,

I am new to arduino so sorry for any mistakes in terms of framing of question and the coding in general.

I am looking to create a device that measures airflow, humidity, and particulate matter. I've blocked out the majority of the code so i can test parts in segments, but I'm running into this one error "error compiling for board arduino uno".

Any help is greatly appreciated.

I have edited the code and removed the excess.

//measuring airflow

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 4);

float CurrentReading;
float Sum;
float Average;
float MeasuresN = 2500 ; // number of measures to average
float Flow;

void setup()
{
  //measuring airflow

  Serial.begin(9600);
  lcd.begin(16, 4);
}


void loop()
{
  //measuring airflow
  for (int i = 0; i < MeasuresN; i++)
  {
    CurrentReading = analogRead(A0);
    Sum += CurrentReading;
    delay(1);
  }
  Average = Sum / MeasuresN;
  Sum = 0;
  
  // To proper measure from 0 m/s airspeed you will need to find curve equation based on your application- I use linear equation to test on fan I had access to.

  ////////////////////////////
  Flow = (Average - 68) * 0.265 + 2.7;
  ////////////////////////////

  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Sensor:"); lcd.print(Average);
  lcd.setCursor(0, 1);
  lcd.print("Airflow:"); lcd.print(Flow); lcd.print("m/s  ");

  delay(5);
}

Code tags, use-em please.

What board are you using? What board did you select?

Hi @invisiblesite

Since you want some help, then help us to help you.

you read the topic:

then correct your initial post and enclose the code in </> tags.
ArduinoForum

OK?

RV - mineirin

1 Like

Please include your code within code tags ... these things </> ... makes things so much easier for anyone that want to check your code.

// This is a comment

/* This is the start of a block comment... 
Comment 1
Comment 2
*/ 

The code you posted has parts of the code commented out....

Sorry, i'm not aware of how to use them yet. I am using an Arduino Uno Board

okay sweet, thank you. I'll try to edit my post!

roger that.

Yes, I've commented out most of the code because I wanted to work in parts and resolve the code one bit at a time. The code has three components 1.Airflow 2. Humidity/Temperature 3. Particulate Matter. I am working to resolve the airflow before moving further.

//measuring airflow

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 4);

Seem to have declared these includes twice.

First one looks to have too many parameters... maybe left over code from a different type of LCD?

In fact... you seem to have 2 complete programs one after the other?

2 x setup()
2 x loop()

Right, that was my mistake i accidentally copied the code twice. Even with it removed I'm still getting the same message.

This looks wrong...

This looks closer...

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 4);

Which one did you remove?

I've removed the duplicate of the setup and loop and also removed " LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);"

Post your latest code - and please use the tags </>...

Oh.. looks like you edited the original post.

That code compiles fine for me... what error(s) are you getting...?

Arduino: 1.8.15 (Windows 10), Board: "Arduino Uno"

C:\Users\User\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp:35:10: fatal error: ../Wire/Wire.h: No such file or directory

#include <../Wire/Wire.h>

      ^~~~~~~~~~~~~~~~

compilation terminated.

exit status 1

Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

this is the message i keep receiving. i am very confused to as to what could be the potential issue here.

Comment out this line...

// #include <Wire.h>

You don't use it yet...

sadly i still get an error message.

Arduino: 1.8.15 (Windows 10), Board: "Arduino Uno"

C:\Users\User\Documents\Arduino\libraries\LiquidCrystal\I2CIO.cpp:35:10: fatal error: ../Wire/Wire.h: No such file or directory

#include <../Wire/Wire.h>

      ^~~~~~~~~~~~~~~~

compilation terminated.

exit status 1

Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Have you got this library installed? (under Manage Libraries search for Liquid Crystal I2C)

This was it! thank you so much! I had installed LiquidCrystal and not LiquidCrystal I2C