how to change the colour of the RGB LED

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to change the colour of the RGB LED

1,506 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc1769 on Wed Oct 10 06:07:30 MST 2012
hi , i have been having problems in changing the rgb led to red.

anyone able to help?

if ((ledMask & RGB_RED) != 0)
                {
                    GPIO_SetValue( 2, 0);
                }
                else
                {
                    GPIO_ClearValue( 2, 0 );
                }
        if ((ledMask & RGB_BLUE) != 0) {
            GPIO_SetValue( 0, (1<<26) );
        } else {
            GPIO_ClearValue( 0, (1<<26) );
        }
        if ((ledMask & RGB_GREEN) != 0) {
            GPIO_SetValue( 2, (1<<1) );
        } else {
            GPIO_ClearValue( 2, (1<<1) );
        }
    }
0 Kudos
5 Replies

849 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by daniel.widyanto on Sun Oct 14 23:56:29 MST 2012
It's suppose to be:
GPIO_SetValue( 2, (1 << 0));
not
GPIO_SetValue( 2, 0);
0 Kudos

849 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc1769 on Sat Oct 13 00:02:44 MST 2012
thanks.... this is giving me a bad headache


Quote: Serge
I did look at the example:p and when i tried to write some 'testcode' with UM and baseboard schematics at hand, i was not able to control all colors of the RGB led on the Embedded Artists baseboard.:(
So i have basicaly the same problem. I guess there must be some hidden catch. :rolleyes:
Anyway for me this is not a hot-toppic but something i try in my spare time and unfortunatly i don't have too much of that at the moment.:(

0 Kudos

849 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Thu Oct 11 00:14:29 MST 2012
I did look at the example:p and when i tried to write some 'testcode' with UM and baseboard schematics at hand, i was not able to control all colors of the RGB led on the Embedded Artists baseboard.:(
So i have basicaly the same problem. I guess there must be some hidden catch. :rolleyes:
Anyway for me this is not a hot-toppic but something i try in my spare time and unfortunatly i don't have too much of that at the moment.:(
0 Kudos

849 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by cfb on Wed Oct 10 17:30:18 MST 2012
If you trying to control the RGB LED on the Embedded Artists Baseboard look at the rgb_joystick example included in the Baseboard LPC1769 examples that you can download from the EA support webpage.
0 Kudos

849 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Wed Oct 10 09:54:56 MST 2012
Ad what IS your problem actually?

From your description we know exactly nothing about the connection of the LED, GPIO setup and the values of control variables you use.
0 Kudos