Go Down

Topic: Problems with Wire.requestFrom (Arduiono Uno v1.0.3) (Read 2 times) previous topic - next topic

Nick Gammon

I just downloaded his latest library, copied it to my libraries folder, restarted the IDE, opened the example, and compiled it, without errors.

irethedo

Where did you store the files and did you need to do anything else to link the I2C.h file?

I keep getting this 'I2c' was not declared in this scope error
on the  I2c.begin()  line of code


Nick Gammon

Inside I2C_Rev5.zip is a folder, "I2C".

Copy that to the "libraries" folder which is under where your sketches folder is (the whole folder, not just its contents).

Restart the IDE.

Then it should work.

http://arduino.cc/en/Guide/Libraries

PaulS

And, you've been told that it is I2C, not I2c. Don't come back until you fix that.

irethedo


Did you restart the IDE after installing the library? Did you install the library?


Thanks Nick!

I thought that I did restart the IDE but I had another instance of it running in the background.

I closed all instances of the IDE and then stated up one instance of it and then I was able to import the library.

I like your scan utility and would like to incorporate that into checking for the device
before reading it but not sure how to convert it over to the I2C.h library functions for the following:

    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)



Go Up