View previous topic :: View next topic |
Author |
Message |
sraiderk
Joined: 09 Feb 2005 Posts: 48
|
CCS C and Fuzzytech |
Posted: Fri Apr 08, 2005 12:09 am |
|
|
I use CCS C and Fuzzytech.I create my project on Fuzzytech. Then I want to use file created by Fuzzytech in c language. But Fuzzytech using bit pointer CCS C do not support it. What can I do? If you want I can gives the sample code. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 08, 2005 12:33 am |
|
|
Sure. Post a small section of code that shows how they use the pointer
and also post the variable declarations. |
|
|
sraiderk
Joined: 09 Feb 2005 Posts: 48
|
|
Posted: Fri Apr 08, 2005 3:56 am |
|
|
in my created file
typedef unsigned short FUZZY;
FLAGS myproj(FUZZY lv0_In1, FUZZY lv1_In2, FUZZY *lv2_Out1);
in include file
typedef unsigned short FTCRTU16;
#ifdef FTLIBC16
typedef FTCRTU16 FUZZY; |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 08, 2005 11:03 am |
|
|
How do you know that FuzzyTech is using bit pointers ?
Normally (in most compilers) a "short" is not a bit.
Defining a "short" as a bit is an invention of CCS.
So I doubt that FuzzyTech really intends to use bit pointers.
My suggestion is that wherever FuzzyTech uses a "short",
you should change it to "int8".
It's possible that it needs to be "int16", but I can't tell from
the code that you posted. |
|
|
Guest
|
|
Posted: Mon Apr 11, 2005 12:21 am |
|
|
You are really correct. I looks code. It uses int16. Result is perfect with CCS C. Thank you very much... |
|
|
mickey231bhq
Joined: 06 Apr 2005 Posts: 19 Location: Formosa
|
|
Posted: Thu Nov 17, 2005 3:33 am |
|
|
can you post success code ~~pls~tks.
ftlibc.h ---->repair for ccs compiler~~~ |
|
|
sraiderk
Joined: 09 Feb 2005 Posts: 48
|
|
Posted: Fri Nov 18, 2005 3:15 pm |
|
|
OK. No problem I changed some definition of variables in FuzzyTech. It gives perfect result with using of 2 tools(CCS C and FuzzyTech). |
|
|
mickey231bhq
Joined: 06 Apr 2005 Posts: 19 Location: Formosa
|
|
Posted: Sun Nov 20, 2005 4:09 am |
|
|
can you send *.h and *.c to me..please..
[email protected]
thanks. |
|
|
turok_gt
Joined: 21 Apr 2010 Posts: 2
|
fuzzytech CCS help |
Posted: Wed Apr 21, 2010 1:48 pm |
|
|
sraiderk wrote: | OK. No problem I changed some definition of variables in FuzzyTech. It gives perfect result with using of 2 tools(CCS C and FuzzyTech).
|
Hi, can you send me the ftlibc.h for CCS compiler? Or any example? I need to use the *.c generated by fuzzytech in CCS compiler for use with the PIC18f2550. Thanks for your help!
My email is: [email protected], or can you post here, help for all. |
|
|
alireza121
Joined: 09 Dec 2010 Posts: 9
|
|
Posted: Wed Dec 29, 2010 1:05 am |
|
|
Hello everybody
Is anybody to help me :
I want to control temperature and humidity by Fuzzy logic. I wrote rule base in Fuzzytech and LabVIEW software and simulated. I got good results. Now I want to implement my fuzzy project by PIC18F452 and want to write the code by CCS. Is anybody that wrote the code by CCS in a project like my project by fuzzy before?
Please send me the code or guide me. How can I write fuzzy in CCS?
Many thanks in advance,
Alireza121 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Wed Dec 29, 2010 3:21 pm |
|
|
Man I thought Fuzzy 'logic' died years ago !!
It's real easy to port to C, just use a few 'case statement' as fuzzy is really just a bunch of if-then-else type code. |
|
|
alireza121
Joined: 09 Dec 2010 Posts: 9
|
Fuzzy logic |
Posted: Thu Dec 30, 2010 1:42 am |
|
|
Hi dear
I know C language and also I know fuzzy logic is bunch of if-then rules,my problem is not this,my main problem is about how to define membership functions(rectangular,triangular,...) in CCS compiler?
Please guide me how to write code of membership functions in CCS compiler?
Looking forward to your kind reply,
Many thanks and merry Christmas,
Alireza121 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Thu Dec 30, 2010 9:38 am |
|
|
There's tons of code on the Web (google...fuzzy code in C)
but I'm bored so ..
Ok, I'll take a stab at it
Code: |
given x=0 to 20...
given y 0..5
rectangular..
if(x>10) and (x<20) y=5
triangular
if(x>14) and (x<16) y=5
if(x>13) and (x(17) y=4
if (x>12) and (x<18) y=3
if(x>11) and(x(x<19) y=2
|
Obviously not in C, but you should get the pattern.
x is the input parameter
y is the output parameter
The 'sharpness' of the function( rect,tri,...) is dependent on how you code the if...statements. |
|
|
|