Installing ACE128 library

I want to use Photon to read the Bourns EAW - Absolute Contacting Encoder (ACE™)
Apparently the library has yet to be added to the Particle IDE.


I’m new to the Photon and just learning my way around. I tried reading how to instal a library but they lost me at altering it for work with the Photon.
I’d appreciate help as the ACE128 is a pretty cool encoder I’d like to use in a project.
Cheers

Welcome to the Particle Community.

How are you planning to use the Bourns Encoder? - direct connection to Photon pins or via a GPIO expander such as the MCP23008 and then use I2C?

Are you using Particle web IDE? If so then the easiest why to use this library is to create a sketch and then add a local file ‘+’ button top right of editor pane and call it ACE128. The system will create 2 files a .h and .cpp. You won’t need the .cpp since the implementation has all been done in the header file. Copy and paste the ACE128.h file from the GitHub link and save.

The code contains several conditional compile statement #if #elif #endif - you just need to uncomment the #define statements relevant to how you wish to use the encoder.

Putting #include "Particle.h" at the start of your application should allow the library to build.

The ACE128test.ino appears to be well commented to explain how it is operating.

That should get you going - shout if you hit any roadblocks.

1 Like

Thank you for such a quick reply.
First off, I was planning to direct connect to the Photon pins.
I’ve tried following your instructions but a few things aren’t clear.
First thing, when I copied and pasted my sketch into the Particle IDE, the plus sign wasn’t there. So I clicked on one of the example sketch’s from Particle and that brought up the plus sign. I then deleted that sketch and pasted in my sketch.
Next you say to “Copy and paste the ACE128.h file from the GitHub link and save.”
Do you mean Just type “ACE128.h” into the .h tab at the top or do you mean open up the ACE128.h file and copy and paste the entire page of code? (I tried both with no luck)
My only experience adding libraries is on the arduino IDE. I just add the entire .ZIP Library.
Is that what I should be putting in th .h tab?

Next I put #include “Particle.h” at the beginning and I’m still getting the error message “ACE128.h: No such file or directory”.

I’ve read through the instructions for contributing a library but the people who write these things assume a certain base knowledge of the reader. The instructions could certainly be dumbed down for people like me.

Thanks for your help.
Cheers
lawrence

First thing, when I copied and pasted my sketch into the Particle IDE, the plus sign wasn’t there. So I clicked on one of the example sketch’s from Particle and that brought up the plus sign. I then deleted that sketch and pasted in my sketch.

When you open the web IDE there is no + shown - you need to create an app first by giving it a name. I have called mine ace128-test.


Next I press on the + and the system creates 2 files Lib1.h and Lib1.cpp. I overtype Lib1 with ACE128.
.
I then copy (from github src) and paste into the ACE128.h file, I save and then delete the ACE128.cpp file. This leaves me with;

You then need to copy the example code from github and paste in the ace128-test.ino file. You then need to comment and uncomment to get the right code for a Photon with direct connection. The main difference will be the pin IDs.

The problem with no such file ACE128.h is that you have not uncommented or inserted the #include for it. See below

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.