sosandroid / FRAM_MB85RC_I2C

Arduino library for I2C FRAM - Fujitsu MB85RC & Cypress FM24, CY15B
Other
56 stars 21 forks source link

Build Error on Example #24

Closed thommaughan closed 4 years ago

thommaughan commented 4 years ago

IDE: Arduino 1.8.9 Board: AdaFruit Feather M0 Example: FRAM_I2C_simple_write_read

FRAM_I2C_simple_write_read:44:11: error: request for member 'begin' in 'mymemory', which is of non-class type 'FRAM_MB85RC_I2C()'

mymemory.begin();

       ^

FRAM_I2C_simple_write_read:52:21: error: request for member 'writeByte' in 'mymemory', which is of non-class type 'FRAM_MB85RC_I2C()'

resultw = mymemory.writeByte(writeaddress, writevalue);

sosandroid commented 4 years ago

Looks like the class is not loaded. Did you import it in the libs folder of Arduino IDE ?

thommaughan commented 4 years ago

I have the library in the directory with all my other libraries. I did not use the arduino IDE to import it though. I have other libraries in the same folder that are copied in and all seems well.

I have been making progress on adding support for the 128Kx8 Fujitsu devices by hacking the Adafruit FRAM library (also copied). I'm a C programmer, and I'm a bit weak on C++ but I suspect something with the object instantiation / constructor call

//Creating object for FRAM chip FRAM_MB85RC_I2C mymemory();

vs the Adafruit way:

Adafruit_FRAM_I2C fram = Adafruit_FRAM_I2C();

On Sun, Feb 2, 2020 at 11:51 AM sosandroid notifications@github.com wrote:

Looks like the class is not loaded. Did you import it in the libs folder of Arduino IDE ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sosandroid/FRAM_MB85RC_I2C/issues/24?email_source=notifications&email_token=AAOBEAY4DFDRMHSVV5BNOY3RA4P3BA5CNFSM4KOZQPAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKR7I4Q#issuecomment-581170290, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOBEA67ZVKA7ISQEOCQ7O3RA4P3BANCNFSM4KOZQPAA .

sosandroid commented 4 years ago

Can you remove the brackets at the object creation ?

FRAM_MB85RC_I2C mymemory;

This is the way the example had been modified a few days ago.

sosandroid commented 4 years ago

Another way is using the constructor providing the chip address and the use write protect

FRAM_MB85RC_I2C mymemory(address, false);

Let me know

thommaughan commented 4 years ago

I'll give it a try when I get a time, thanks for the help

On Mon, Feb 3, 2020 at 11:43 AM sosandroid notifications@github.com wrote:

Another way is using the constructor providing the chip address and the use write protect

FRAM_MB85RC_I2C mymemory(address, false);

Let me know

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sosandroid/FRAM_MB85RC_I2C/issues/24?email_source=notifications&email_token=AAOBEA4U6A7ZRPHRDDTQAZTRBBXXDA5CNFSM4KOZQPAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKVEMDQ#issuecomment-581584398, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOBEA2I5P3HCTRLUTLOKIDRBBXXDANCNFSM4KOZQPAA .

sosandroid commented 4 years ago

No feedback, I am closing the issue