This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How do I add two outputs together?

Hi all,

I have a quick question about code. I'm making an LED array project where each output is a letter in a name. The code looks something like this:

#define A P1OUT=0x01;

#define L P1OUT=0x02;

// define all other letters in the name here

while(1){

A;

__delay_cycles(10000)

L;

__delay_cycles(10000)

// Light up each other letter in the name one by one.

Now my question is - how do I light up more than one letter using this #define method? I would imagine it's:

A + L   or   A || L   or    A && L    etc, something to this effect. But I can't get any of those to work. I would prefer to do it this way rather than determine the hex output for every combination, so as to make it easier to design the PCB in case I need to change the outputs around. 

Does anyone know?


Thank you.

**Attention** This is a public forum