<font face="Courier New" size=-1>There`s a Problem !
I've to make a projekt.
I should get a 14 bit ttl datastram from an ir-receiver module and have to read this data with a pic16c745.
To control my hardware i have to compare this 14 bit wide code with an array of n codes with 14 bit.If there's a code which is equal the pic performs an operation.
I don't know how i can manage this !
Please help me !!
Yours chriss</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 9329
Tomi Guest
Re: Array in CCS, Please help me !!!!!!
Posted: Sun Nov 24, 2002 12:24 pm
What is about the good old "switch" statement something like this:
unsigned long indata; // ulong is 16 bit in CCS C
#define OPCODE1 0x3C01
#define OPCODE2 0x3C02
#define OPCODE3 0x3C03
...........
#define OPCODEn 0xXXXX
indata = Receive_14_bits();
switch (indata) {
case OPCODE1: DoSomething1(); // first case
break;
case OPCODE2: DoSomething2(); // 2nd case
break;
........ // other cases
default: HandleError(); // none of above: illegal command
break;
}
:=<font face="Courier New" size=-1>There`s a Problem !
:=I've to make a projekt.
:=I should get a 14 bit ttl datastram from an ir-receiver module and have to read this data with a pic16c745.
:=To control my hardware i have to compare this 14 bit wide code with an array of n codes with 14 bit.If there's a code which is equal the pic performs an operation.
:=I don't know how i can manage this !
:=Please help me !!
:=Yours chriss</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 9341
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum