Error - can't find header file

I get this error message when I try to to run my scale02.ino sketch from my

C:\Users\Gene\Scale_02\ directory.


C:\Users\Gene\Scale_02\Scale_02.ino:4:19: fatal error: hx711.h: No such file or directory

#include <hx711.h>
^
compilation terminated.

exit status 1
Error compiling.

In the directory are these 2 files:

++++
hx11.h
++++

/* Arduino library for digital weight scale of hx711
*

#ifndef HX711_H_
#define HX711_H_

#include “Arduino.h”

class Hx711
{
public:
Hx711(uint8_t pin_din, uint8_t pin_slk);
virtual ~Hx711();
long getValue();
long averageValue(byte times = 32);
void setOffset(long offset);
void setScale(float scale = 742.f);
float getGram();

private:
const uint8_t _pin_dout;
const uint8_t _pin_slk;
long _offset;
float _scale;
};

#endif /* HX711_H_ */

and

+++++++
le0

The last message got cut. The 2nd file is Scale02.ino
+++++++++++++++++++++++++++++++=

// Hx711.DOUT - #pin #A2
// Hx711.SCK - #pin #A23

#include <Hx711.h>
Hx711 scale(A2, A3);

void setup()
{
Serial begin(9600);
}

void loop()
{
Serial print(scale.getGram(), 1);
Serial rintln(“g”);
delay(200);
}

Please use code tags next time.

But did you download that library? And where did you place it?

#1 - I gave you the code just as I downloaded it. As far as code tags are concerned (fricking or otherwise) what you see is what you get. I'm not a C++ programmer and depend on downloaded programs to work.

#2 - Yes, I downloaded that library and as I stated, I put the hx711.h file in the same directory as the Scale02.ino sketch.

#3 - Upon examining the Scale02.ino sketch (which I simply renamed from the name given to it (Scale.ino and yes, I did rename the directory), I find the file is corrupted where the periods were missing after the "Serial" statement among other errors.

#4 - So my question now becomes, can anyone give me a new link with an Arduino sketch and header file for a digital scale that works?

  1. You should probably read the section “how to use this forum” to know what “code tags” is used for

  2. That’s not the correct way to include a livrary, but if you want to do it that way, you should write #include "hx711.h" instead

  3. That’s correct. Actally, everything in your loop is “corrupted”

  4. You can use google to search for a new code, or you can spend an hour of reading about basic arduino programming and fix the code u already have.

gbuza:
#1 - I gave you the code just as I downloaded it. As far as code tags are concerned (fricking or otherwise) what you see is what you get. I'm not a C++ programmer and depend on downloaded programs to work.

No you didn't post what you downloaded, you copied and pasted, or saved a file. If you posted exactly what you downloaded, it would look like an attached file.

Nothing wrong with copy & pasting, but since you have attitude about playing nice and using code tags, then it won't work.

#2 - Yes, I downloaded that library and as I stated, I put the hx711.h file in the same directory as the Scale02.ino sketch.

That's not where it goes.

#3 - Upon examining the Scale02.ino sketch (which I simply renamed from the name given to it (Scale.ino and yes, I did rename the directory), I find the file is corrupted where the periods were missing after the "Serial" statement among other errors.

See comment 1.

#4 - So my question now becomes, can anyone give me a new link with an Arduino sketch and header file for a digital scale that works?

[/quote]

What was your original question? It read like you were ranting.

Look, you haven't said where your library comes from, or what you expect it to do, how you have it hooked up, etc. In fact you haven't given any information at all, other than it doesn't work. And you expressed frustration.

gbuza:
#1 - I gave you the code just as I downloaded it. As far as code tags are concerned (fricking or otherwise) what you see is what you get. I’m not a C++ programmer and depend on downloaded programs to work.

How to lose friends and alienate people.” You should lose the attitude, and do what’s suggested. When posting code or error messages it MUST be between code tags. It’s not too late to go back and edit your opening post, to add code tags.

#2 - Yes, I downloaded that library and as I stated, I put the hx711.h file in the same directory as the Scale02.ino sketch.

You should install 3rd-party libraries in the “\Sketchbook\libraries” folder. Then they can be used by other future programs, and can be included the way you’ve done:-

#include <hx711.h>

Otherwise, if you insist on placing the library in your sketch folder, you need to include it like this, (as suggested by dorvatka):-

#include "hx711.h"

#4 - So my question now becomes, can anyone give me a new link with an Arduino sketch and header file for a digital scale that works?

Do you have direct links to the library you’re using, (there’s more than one “HX711” library), and the code that you copied that has those errors?