LiquidTWI issues...

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
boinerz
 
Posts: 3
Joined: Sun Apr 14, 2013 12:00 pm

LiquidTWI issues...

Post by boinerz »

Seriously, you must update the serial backpack driver to support your product.

Arduino "Wire" library has been updated, deprecating the dot-send to a dot-write function reference. As well, an update to Print seems to affect LiquidTWI.

I'm using the BETA 1.5.2 Version of Arduino with MEGA2560. Have worked upgrading in Atmel Studio, came close getting it all to compile in Atmel Studio but not in Arduino. Still working to resolve these problems.

Of course, if you guys ever do come up with a working update or LiquidTWI replacement, with you please let me know?

(Am new to C, and C++, learning there is much to know from the experience, which I would like to minimize as much as possible while hacking. Now working to test an example Class library (the Arduino Morse example.) My own test of the simplest library possible generated an unbelievable bunch of errors base on default STD inclusion. Once I correct the syntax, my changes will probably compile in Arduino.)



Thank you.

-C. Prichard

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: LiquidTWI issues...

Post by adafruit_support_mike »

We're doing a lot of work updating libraries and porting them to platforms like the DUE, and abstracting the new Wire methods is on the to-do list. It's mostly a question of which libraries we've gotten to so far.

The code we're using to do the abstraction looks like this:

Code: Select all

/**************************************************************************/
/*!
    @brief  Abstract away platform differences in Arduino wire library
*/
/**************************************************************************/
static uint8_t i2cread(void) {
  #if ARDUINO >= 100
  return Wire.read();
  #else
  return Wire.receive();
  #endif
}

/**************************************************************************/
/*!
    @brief  Abstract away platform differences in Arduino wire library
*/
/**************************************************************************/
static void i2cwrite(uint8_t x) {
  #if ARDUINO >= 100
  Wire.write((uint8_t)x);
  #else
  Wire.send(x);
  #endif
}
You should be able to refactor that into your own libraries while you wait for an official update.

boinerz
 
Posts: 3
Joined: Sun Apr 14, 2013 12:00 pm

Re: LiquidTWI issues...

Post by boinerz »

THX,, am looking forward to update and improved TWI.

I had excellent results with 3-part tutorial: http://www.jayconsystems.com/tutorial/atmel/

Now programming Arduino in Studio6 with 1.52 CORE.

I had trouble creating Arduino Studio a template project complete with logo, hoping to bypass need for setting paths in each project. Once main is changed, error in Studio is "bad reference to Main." Unfixable it seems. Other issue is learning not to include header files with CPP files in Studio, but it is a great IDE.

Am working on some stuff, looking to interface 2013 building a CORE as in the above tutorial. What a great way to get going on the AVR! Pasted tutorial info with ADAfruit TinyAVR programmer and it worked. First time I got it working!

-C

User avatar
dewy
 
Posts: 12
Joined: Mon Feb 20, 2012 12:38 am

Re: LiquidTWI issues...

Post by dewy »

Looking at the code on Her github page, (as per date of this post) it appears to have been updated to support IDE versions 1.0 and above.

Excerpts:
From LiquidTWI.h

Code: Select all

#if ARDUINO >= 100
	virtual size_t write(uint8_t);
#else
	virtual void write(uint8_t);
#endif
And from LiquidTWI.cpp

Code: Select all

#if ARDUINO >= 100
  #include "Arduino.h"
#else
  #include "WProgram.h"
#endif
further down...

Code: Select all

#if ARDUINO >= 100
	Wire.write((byte)MCP23008_IODIR);
	Wire.write((byte)0xFF);
	Wire.write((byte)0x00);
	Wire.write((byte)0x00);
	Wire.write((byte)0x00);
	Wire.write((byte)0x00);
	Wire.write((byte)0x00);
	Wire.write((byte)0x00);
	Wire.write((byte)0x00);
	Wire.write((byte)0x00);
	Wire.write((byte)0x00);
#else
	Wire.send(MCP23008_IODIR);
	Wire.send(0xFF);
	Wire.send(0x00);
	Wire.send(0x00);
	Wire.send(0x00);
	Wire.send(0x00);
	Wire.send(0x00);
	Wire.send(0x00);
	Wire.send(0x00);
	Wire.send(0x00);
	Wire.send(0x00);
#endif
Finally for convenience, a link to Her official code:
https://github.com/Stephanie-Maks/Arduino-LiquidTWI

Cloned for 'safe keeping' on my repo as well. ;)
https://github.com/dewy721/Arduino-LiquidTWI/

All in all, I'd say that its been nicely updated; even keeps backward compatibility.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”