lpcware

Easy port/pin reading writing LPC1768

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by sojiro on Mon Aug 23 10:59:56 MST 2010
Hello everyone
I cannot find any example on how to read a pin
plus if someone can tell me, i want examples for port reading and writing and
just one pin reading/writing

So far i found these
LPC_GPIO2->FIODIR |= (0<<12);//P2_12 as input
LPC_GPIO0->FIODIR |= (1 << 22);//P0_22 as output

LPC_GPIO0->FIOSET = (1 << 22);//output "1"
LPC_GPIO0->FIOCLR = (1 << 22);//output "0"

Should i use PINSEL registers everytime i use a GPIO pin?i  thing default is 00

I would appreciate any help

Outcomes