Convert Fuzzy Library for Arduino to the Propeller
AS
Posts: 149
in Propeller 1
Hello everyone.
This is a great library for Fuzzy Logic: <http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino.html>
I want use it in propeller. Any sugestion?
Thanks!
AS
This is a great library for Fuzzy Logic: <http://www.zerokol.com/2012/09/arduinofuzzy-fuzzy-library-for-arduino.html>
I want use it in propeller. Any sugestion?
Thanks!
AS
Comments
SPIN ? PASM?
C/C++ with GCC ... ??
http://onerobot.org/products/viewport/
I prefer have the Fuzzy library in SPIN!
How is the easy way for use the Fuzzy library for arduino that already exist?
C/C++ with GCC I think can be easier (but not easy for my knowledge) but I have no idea the difficulty level.
thanks for the interest
AS
Thanks for the sugestion.
AS
Here's the output I got using xmmc on the Quickstart:
No idea what this means! But it works
Fuzzy logic is a great solution to control systems/machines, in some situations better than PID, when we have nonlinear systems is better. I have some knowledge about FL but simulated and controled in LabView, at this moment I already can simulated in LabView and control with Arduino, but in my opinion when we think in machines/systems we need more cores and I think the Propeller is a better solution.
I published a paper about this work (controled and simulated in LV) <http://www.mirlabs.net/nabic14/proceedings/html/paper25.xml> (see the attach file) I can explain the example of that paper in other words.
I want to replicate/learn what you have done with PropGCC and learn how you make that static libraries and header files for the SimpleIDE (if it isn´t very dificult. I hope you can help me.
It overflows with the simple sample? It is not good, I put 2 functions like the advanced sample and the serial comunication in Leonardo Arduino.
Any question about FL, just ask.
Sorry for any mistake in my english.
My
Goodness.
I am duuummbbb
I was not compiling the library with any flags - not even optimization! I need to make an enhancement to PropWare so that it is easier to compile libraries, but long story short, even the "general_advanced_sample" compiles in LMM mode with propeller-load reporting 26.5 kB being sent to the prop (so probably 24-25 kB binary size).
I'm writing up a full description of how I made this work. Look for it in a few minutes.
As the author of PropWare, that was my goto choice for attempting to build eFFL. I forked the eFFL project and then added two files to it which are used with CMake - a Makefile generator build system. PropWare is build using CMake and is really easy to use.
So, in the root directory of eFFL, I added a file named CMakeLists.txt, and placed the following content:
Line 1 determines which version of CMake is required. PropWare has a very strict requirement on CMake 3.3 at the moment. The second line imports everything necessary to build projects for the Parallax Propeller using PropWare's build system. Next is the "project" function, which simply declares that we have ourselves a project named "eFFL". Following that we set the memory model. Read all about memory models here. the "set_compile_flags()" function is supposed to be an internal part of PropWare, and I ask that you please ignore this line for the moment. When I finish making the enhancement to PropWare (it will be a PropWare 2.1 release), you will no longer need that line.
We then create the library. The first line, with "eFFL" in it, declares the name of the library. Following that is the name of every source file - you can include the file extension if you wish, but it is not necessary.
At this point, you have everything you need to compile the static library. Simply execute the following on the command line, starting from the project root:
And you'll find libeFFL.a in <project root>/bin/libeFFL.a.
The final line, add_subdirectory(...), simply says "look in the examples directory for some more configuration". The file examples/CMakeLists.txt just has a couple lines that describe how to build executables. The create_executable function takes a couple arguments, very similar to "add_library". The first argument is the name of the executable, and all remaining arguments are source files (with or without file extensions). The "target_link_libraries" function allows you to link libraries with executables - so you can see the first argument to that function is the name of the executable, and all remaining arguments are the libraries you want linked.
You can see my full commit here. I made very basic changes to the example source code to replace references to std::cout with PropWare's pwOut, which is similar but smaller.
Really thanks. I will try everything you explain and I will have doubts for sure.
I left a lot of blanks there, so do please feel free to ask any questions. I suppose there's one really big and important step I should have mentioned already: you'll need PropWare installed
http://david.zemon.name/PropWare/Download.xhtml
Note that the first option on that download page, "SimpleIDE" won't work for you because it only includes the PropWare libraries and headers - not the build system.
- I Installed PropWare for Windows.
- In the root directory of eFFL, I added a file named MakeLists.txt, and placed the content you wrote.
When you say: "At this point, you have everything you need to compile the static library. Simply execute the following on the command line, starting from the project root:"
I need execute CMake?
When I execute CMake or CTest or CPack it open and close so fast that I can´t read nothing :snooty: . It´s normal? What I´m doing wrong?
Thanks
You forgot the "C" at the front. CMakeLists.txt
Also, remove the final line - the one that reads "add_subdirectory(examples)". We'll get the static library compiling and then try the examples.
CMake, CTest, and CPack are all interactive command-line tools that require certain arguments to execute correctly.
Keep in mind two things as I walk you through the instructions for this: 1) I am more than happy to bundle up the static libraries and headers for you at any time, and 2) I am more than happy to continue answering your questions as long as you like.
Now, on to answering your question.
GNU Make
You'll need GNU Make (make.exe) installed on your machine. There are lots of different ways to do this. One of the easiest is to download and install this file.
Once installed, add the folder containing "make.exe" to your PATH variable. If you are using a 64-bit machine that is Windows Vista or newer, then the path is most likely "C:\Program Files (x86)\GnuWin32\bin"
Preparing the command line
Open the terminal by typing "cmd" into the start menu and selecting the option titled "Command Prompt".
You should get a screen that says something like:
Type "where cmake" and press enter. If you don't see something along the lines of "C:\PropWare\PWCMake\bin\cmake.exe" then you forgot to add CMake's bin directory to your PATH. See Step 3 of "Microsoft Windows" on PropWare's download page.
Note that each time you modify the PATH variable, you'll need to close and re-open the command prompt.
A message such as "INFO: Could not find files for the given pattern(s)." means that you did not set the PATH variable correctly.
Once "where cmake" returns the path to the CMake executable, try "where make". This should return the path to make.exe.
Running CMake
Let's assume you downloaded eFFL to a directory named "C:\Users\AS\eFFL", and therefore you have a file named "C:\Users\AS\eFFL\CMakeLists.txt". In the command prompt, type the following commands. This will create a new directory to store CMake generated files, object files, and the static library and then build everything.
If all goes well, you should now be able to see libeFFL.a in your file browser.
Okay! I think that should do it. Let me know if anything doesn't go smoothly, and we'll get it fixed!
But when I write:
It gets bloked. (see the file attached)
I will wait you tell me the next step...
Thanks a lot!
I don't see an attached file
I attached now.
Now when I write:
It gets bloked.
My computer has about 8 years, CPU usage is not more than 40%.
I send attached where it blocks, it make some files and directories.
It should creat the file libeFFL.a in the bin directory? If you send me this file I can continue the process from here?
(I think the reason is that my computer have a lot of junk?!)
thanks
As for your system... 8 years is pretty old... but it shouldn't be so old that CMake freezes on you. Let's try putting cmake into trace mode. Instead of
let's try
And see where that gets you.
Putting cmake into trace mode is to see where it freezes?
I sending the file attached.
Thanks a lot
At that point, you can write your code and link against the project. Try executing this code from your project in SimpleIDE. It's the general_simple_sample file, using PropWare's serial communication. You'll need to add both PropWare and eFFL to your project. In other words, you'll need to run through the "SimpleIDE (Any Operating System)" instructions twice: once for PropWare, once for eFFL.
https://github.com/DavidZemon/eFLL/commit/12d25c777b73d1fdf1b5934df7631c5cbf1945b2
Of course, you can also use libpropelleruino. It hasn't seen activity in a long while, but I suspect it still works all the same: https://code.google.com/p/lib-propelleruino/
I think I had done everything right, but I got this error (see the file attached).
Where I can download it? (I don´t see any link to download)
You have any sugestion where I can learn something about that?
Thank you
Common problem Simply rename your program from *.c to *.cpp. The compiler won't recognize it as a C++ program until you change the file extension to "cpp".
It may be available as source only. I'm afraid I really don't know too much about that library, other than it aims to be Arduino-compatible. No idea how far along it is, or how close to "compatible" it got. Here's the git clone command: https://code.google.com/p/lib-propelleruino/source/checkout
SimpleIDE freezes at 88% when building.
what I´m doing:
1. Open SimpleIDE
2. New Project: general_simple_sample.cpp
3. Copy paste the code
4. make everything you say in "SimpleIDE (Any Operating System)"
Add the path for Include and Library to the eFLL and PropWare-Generic
What you think it can be?