I searched the forum and found some post and replies on a particular eFLL library problem. In some cases the output from controller is 0 (zero) no matter what. I have this same problem on my code.
PS: As all the topics on it were very old, I found it to be a good idea to post a new one.
When your code requires a library that's not included with the Arduino IDE please always post a link (using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.
Hello. I have been facing the same problem as you for the past two days and had not found a solution anywhere. When I saw your post I was at least relieved that I wasn't alone in this.
I spent the entire day trying to debug this code and there was no mistake to be found, yet the thing didn't work. After doing some very boring tests, I noticed that the problem was that for some weird reason, the library was "ignoring" whatever value my input was, and was considering it to be zero. For example, I had two inputs, and in the loop I had:
And it was basically ignoring whatever value KPE and KDDE were equal to, and was always considering the inputs to be zero, and was evaluating the pertinences as if my inputs were zero, although they were not when i printed them out. I even changed my pertinence curves so that they would have different values at a zero input, and when i printed the pertinences, i got the new pertinence values according to a zero input, which means that it was evaluating the pertinences correctly and the fuzzification was happening just fine.
At the end of a very frustrating day I finally figured out how to fix this, although I still don't know exactly why this happens, here it goes.
The problem seems to be that I was doing an operation inside the setInput() function. By that I mean tere was a multiplication in there (KPE and KDDE), and for some reason it would not simply evaluate the multiplication and then use the result as an input. So I first evaluated the multiplication before calling the function, and then I put a single variable as a parameter for the function like this:
E = EKP;
DE = DEKD;
fuzzy->setInput(1, E);
fuzzy->setInput(2, DE);
As soon as I did that, it magically started working like a charm.