CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Array in CCS, Please help me !!!!!!

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
chriss
Guest







Array in CCS, Please help me !!!!!!
PostPosted: Sun Nov 24, 2002 5:37 am     Reply with quote

<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 !!!!!!
PostPosted: Sun Nov 24, 2002 12:24 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group