Difficulty with adding library - Adafruit_Seesaw


#1

Hi all,

I’m trying to get an example going that is in the Adafruit_Seesaw library.
I’ve been trying it in the IDE, and in Workbench, but both are giving my trouble.

Using the IDE: I go to the library, then find the example joy_wing_oled.ino

I use that example, and it opens an app with that name and includes the library. I try to compile for an Argon, and it fails with:

joy_wing_oled.ino:2:26: Adafruit_GFX.h: No such file or directory

So I find and add that library and try again, getting:

joy_wing_oled.ino:6:58: Adafruit_ST7735.h: No such file or directory

So I find and add that library too, and get this again:

joy_wing_oled.ino:6:58: Adafruit_ST7735.h: No such file or directory

I cannot, using the example, get the library recognized.

Any Ideas?

Now in Workbench, I can get one or sometimes two of the libraries added, but then get the following error on the later added library:

{
	"resource": "Particle/projects/TFTwingTest/TFTfeatherwing/src/TFTfeatherwing.ino",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 2,
	"message": "#include errors detected. Please update your includePath. IntelliSense features for this translation unit (/Users/jimlivingston/Particle/projects/TFTwingTest/TFTfeatherwing/src/TFTfeatherwing.ino) will be provided by the Tag Parser.",
}
{
	"resource": "Particle/projects/TFTwingTest/TFTfeatherwing/src/TFTfeatherwing.ino",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 2,
	"message": "cannot open source file \"../Adafruit_GFX.h\" (dependency of \"Adafruit_GFX.h\")",
}

The strange thing is that I add the library in exactly the same way as the other libraries that are included without issue…

FYI: MacOS version 10.14, Visual Code Version 1.30.2 (1.30.2), not sure how to check workbench version, but my machine assures me that there is no update available.


Adafruit Joystick TFT featherwing
#2

The problem is that the library itself doesn’t require any of these libraries for itself to function, hence there are no dependencies in the library.properties file for them.
But the example does require these libraries. However, library examples (currently) can’t have their own project.properties file which would allow them to register dependencies.

But for Adafruit_GFX you shouldn’t include that but rather change it to Adafruit_mfGFX because the Adafruit_ST7735 library that’s available for Particle already brings its own copy of Adafruit_mfGFX.
Since the Adafruit_ST7735 library is rather old it’s missing this statement

#define INITR_MINI160x80  0x04

Hence you need to add this line to the example code, but since the library doesn’t know about that form factor and assumes 160x128 it’s rather likely that the display won’t properly work with that resolution.

The way out of that would be that you need to import these required secondary libraries yourself.

With all these changes the example builds for me (target Argon 0.8.0-rc.27)
https://go.particle.io/shared_apps/5c384693e359967913000711

Good practice to prevent this confusion would be to add a code block at the top of each example that clearly states the need for secondary libraries.

@bsatrom, I see this lib was contributed by you. Could you please add these comments and maybe lobby at Particle to allow for project.properties in library examples. I’ve repeatedly proposed that in the past :wink:

We also discussed the ability for Particle and Elites to take over outdated libraries, ST7735 might be such a candidate as a related issue is still unaddressed by the owner for almost a year


Adafruit Joystick TFT featherwing
#3

Sorry about that @jimbol, I’ll get this library fixed up and updated. Could you, by chance submit an issue at https://github.com/bsatrom/Adafruit_Seesaw so I can make sure to do it?

And thanks @ScruffR, will do. :smiley:


#4

Thanks @ScruffR for spending the time! I’ve been giving it some work, and am able to build with your code, but I get an Error at

if(!ss.begin(0x49))

when running the code. I am getting closer bit by bit…


#5

Thanks @bsatrom

I just followed your link, but couldn’t find a way to start an issue.

I can see the issues tab at adafruit/Adafruit_Seesaw that you forked from, but not on your repository.

Could just be me not knowing what to do, this will be the first time I’ve put in an issue.


#6

Whoops, that’s right. Issues weren’t enabled for that repo. I just did so.


#7

Done!


#8

So in trying to get the Seesaw library going with this display:

I’ve had to change the address here:

if(!ss.begin(0x5E))

I’m still having issues in getting things going, only half the buttons work, and not the display yet, but it’s getting closer.


#9

Hey @jimbol, are you still having trouble getting this to work?


#10

There is a working combination of libraries for using the Adafruit Mini Color TFT with Joystick FeatherWing listed here:

https://docs.particle.io/community/feather/#adafruit-color-tft-joystick-featherwing


#11

@bsatrom, @rickkas7

Thanks for checking on me! I think in addition to the library I was also having a hardware problem, as the I2C on this display stopped responding, so I’m trying to get a replacement from Adafruit currently.

I’m having some success with the 2.8 touchscreen TFT, though, so have been able to shift onto another display for the time being.


#12

Glad to hear. Let us know if you run into any further issues!


#13

@bsatrom,

I am also trying to use the seesaw library - this time to get the Adafruit capacitive soil moisture sensor to work. I used the version of this library in the Particle library manager and with @m_m 's help can flash the Boron but, the device is not responding. Any advice on troubleshooting? Anyone have experience getting this to work?

Thanks, Chip


#14

Hey @chipmc are you using this one? https://www.adafruit.com/product/4026?gclid=CjwKCAiA_P3jBRAqEiwAZyWWaKU_Fzr8YWtktG_Ru2BLUWGtG-K1dIuhtxRtl3hl-UMv0L4FzFX5KxoCw90QAvD_BwE. If so, I’ll grab a couple and verify when I get back home.

Are you getting no response from the Boron, or nothing at all from the moisture sensor?


#15

@bsatrom,

Thank you for responding.

Yes, that is the one.

Figured it out. In the example code, the i2c address for the device is wrong. Once I fixed that, it started working. If you are the one who maintains the library, you may want to change this line in the soilmoisture example so others don’t bang their heads against the wall like I did:

if (!ss.begin(0x36)) {

Thanks,

Chip


#16

@bsatrom,

Sorry, one more thing if I may -it is a nit.

The following line in the in Adafruit_seesaw.h is causing a “Problem” warning in Particle Workbench on compile. Wonder if it could be removed for the Particle Library version though it clearly is not causing a functional issue:

Line 23 - #if (ARDUINO >= 100)

Thanks,

Chip


#17

No problem @chipmc, I fixed the example and removed the Arduino check. Just pushed a new version with both of those changes.


#18

@bsatrom,

Wow! that was fast.

Now, I need to figure out how the new Particle Workbench handles updates like this. I will ask elsewhere but, do I need to un / reinstall the library to get the updates?

Thanks again for your help

Chip


#19

:smiley:

If you run the Install Library command again, it should increment the version in your project.properties to v 0.0.5. If you see that, you should have the latest. LMK if it doesn’t work!


#20

Brandon, could the (ARDUINO >= 100) be a side effect of these issues


There were no official responses to these issue reports but they should be addressed better sooner than later especially since they would be an easy fix.