How to turn led on (programming)

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

How to turn led on (programming)

418 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zxcxz on Tue Oct 25 03:08:56 MST 2011
In C programming, how can I turn these 2 leds on ? Yes, it's a simple example. But I'm not good on C programming :o I try to learn 1769 programming with examples. Also I'm at the begining.

Thanks for replies.

[IMG]http://img851.imageshack.us/img851/5787/ledturnon.jpg[/IMG]
0 Kudos
7 Replies

402 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Thu Oct 27 23:37:27 MST 2011
Before i get even more confused :confused: on halloween i will just stop reading this forum and stick to the user manual.
And that flux capacitor? once a great invention back in 2053 BC :D
0 Kudos

402 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Oct 26 00:44:22 MST 2011
Already Halloween or just another confusing-the-confused day :confused:


Quote:

There is only 1 (ONE) pin (PIO0_22) able to drive a led without extra electronics.

What kind of 'extra electronics' do you suggest to use for my Low Current (2mA) LEDs? A flux capacitor :confused:

LPC_GPIO0->FIODIR = 1 << 2;
LPC_GPIO0->FIODIR = 1 << 4;
You don't really suggest that :eek:
0 Kudos

402 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nagaraj.baddi on Wed Oct 26 00:01:04 MST 2011
//First set the direction for PORTS

LPC_GPIO0->FIODIR = 1 << 2;
LPC_GPIO0->FIODIR = 1 << 4;

LPC_GPIO0->FIOSET = 1 << 2;     //P0.2 LED get on

LPC_GPIO0->FIOCLR = 1 << 4;   //P0.4 LED get on

:):)
0 Kudos

402 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Tue Oct 25 23:26:34 MST 2011
My humble opinion is that you will blow up your LPC1769 with that schematic.:eek: There is only 1 (ONE) pin (PIO0_22) able to drive a led without extra electronics.:p
I hope I just gave the right pin number as i am typing this in a hurry.
0 Kudos

402 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Oct 25 03:30:45 MST 2011

Quote:
But I don't own my card yet, waiting for the cargo.

And your brain and your glasses are also in that cargo :confused:

In that sample are 2 files included: leds.h and leds.c :eek:

What do you think are they doing :confused:

Note: A good point to start could be reading the user manual :)
0 Kudos

402 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by zxcxz on Tue Oct 25 03:24:59 MST 2011

Quote: Zero
Then import and read this sample: RDB1768cmsis2_SysTick :eek:



I did :) But I don't own my card yet, waiting for the cargo. So, I can't test the code changes I do :o
0 Kudos

402 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Oct 25 03:20:45 MST 2011

Quote: zxcxz
...I try to learn 1769 programming with examples..



Then import and read this sample: RDB1768cmsis2_SysTick :eek:
0 Kudos