Boolean operations with psoc

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 How can i make boolean operation without logic gate in component catalog? i want to use only sorce code, but getting error while using "bool". it said "bool undefined identifier"

0 Likes
5 Replies
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 but then i tried to resolve this and got like the picture, will this work?

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Keil data types -

   

 

   

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 i made like this

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

 You can use CYBIT instead of 'bool'.

   

odissey1

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Standard C-Language allows you to define your own types. So a

   

typedef unsigned char Bool;

   

and something like

   

#define FALSE 0

   

#define TRUE (!FALSE)

   

will give you some basics. Then you may use all the boolean operators as &&, ||, ! (which are logical AND, OR, NOT)

   

Bool a, b, X;

   

X = a & b;

   

X = (!a || b) && (a || !b);

   

if(X){...}

   

 

   

 

   

Bob

0 Likes