Thanks Igor - this is the code produced by fuzzy tech - it's a simple analogue in analogue out to test with mbed. I don't know how to assign the input and output to the mbed 'pins'
Many Thanks
Tony
/*---------------*/
/*--- fuzzyTECH 5.71 Professional Edition ---*/
/*----- License Number: FT 10002 87 ID ----*/
/*---------------*/
/*---- Code Generator: C Source Code ----*/
/*--- Code Generation Date: Tue Mar 08 23:51:50 2011 --*/
/*---- Fuzzy Logic System: ANALOGUE ---*/
/*- Performance Optimization Capabilities (Memory): 6 Bytes -*/
/*- Performance Optimization Capabilities (Runtime): 10 Points */
/*---------------*/
/*- (c) 1991-2007 INFORM GmbH, Pascalstr. 23, 52076 Aachen, Germany -*/
/*---------------*/
- define PROFESSIONAL
- define FTLIBC16
- include "ftlibc.h"
- define FUZZYDEFINED
- define FLAGSDEFINED
- include "ANALOGUE.h"
static FUZZY crispio[1+1];
static FUZZY fuzvals[3+3+0];
static double dcvs[1+1];
double * const pcvanalogue = dcvs;
static const FUZZY tpts[12] = {
0x0000, 0x0000, 0x0000, 0x8000,
0x0000, 0x8000, 0x8000, 0xFFFF,
0x8000, 0xFFFF, 0xFFFF, 0xFFFF};
static const FUZZY xcom[3] = {
0x0000, 0x8000, 0xFFFF};
static const BYTE rt0[9] = {
0x00, 0x01, 0x03,
0x00, 0x01, 0x03,
0x00, 0x01, 0x05};
static const FRAT frat0[6] = {
0x0003, 0x0000, 0x0003, 0x0001, 0x0003, 0x0002};
static const FUZZY BVRCode[4] = {
0x0000, 0xFFFF,
0x0000, 0xFFFF};
static const double BVRShell[6] = {
0, 1, 2e-005,
0, 1, 2e-005};
FLAGS analogue(void) {
crispio[0] = BVScaleShell2Code(&BVRCode[0*2], &BVRShell[0*3], dcvs[0], BVRCode[0*2+1]<MAXBVRANGE, MAXBVRANGE);
fuzptr = (PFUZZY) fuzvals;
tpptr = (PFUZZY) tpts;
crisp = crispio[0];
bTNum = 3;
flms();
fuzptr = (PFUZZY) fuzvals;
usNumber = 3;
fratptr = (PFRAT) frat0;
rtptr = (PFTBYTE) rt0;
iBMin(); /* BSum-Min */
invalidflags = 0;
fuzptr = &fuzvals[3];
xcomptr = (PFUZZY) xcom;
crispio[1] = 0x8000;
bTNum = 3;
defuzz = &crispio[1];
com();
dcvs[1] = BVScaleCode2Shell(&BVRCode[1*2], &BVRShell[1*3], crispio[1]);
return invalidflags;
}
void initanalogue(void) {
/* check fuzzyTECH C Runtime Library version */
ftcr200706();
for (fuzptr = &fuzvals[3];
fuzptr <= &fuzvals[5];
/*
------------ |
Memory | RAM | ROM |
------------ |
Fuzzy Logic System | 32 (0020H) | 111 (006FH) |
------------ |
Total | 32 (0020H) | 111 (006FH) |
------------ |
Hiya,
I'm new to mbed and have just managed to get a switch and LED operating. I'm trying to load a fuzzy tech programme in C to mbed and I can't compile it. Can anybody help? Thanks