LPC 1227 - how to read value from GPIO input?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by ElMoe on Mon Jan 26 07:36:04 MST 2015
Hello to all,

i am very new to embedded programming and so i have a very simple question, which i wasn't able to answer by myself.
I have experiences with JAVA and fundamental knowledge with Python and C by using a RaspberryPi.

For a traineeship i now have a PREV601 blueboard (information to PREV601) witch includes among others a LPC1227, two led and two buttons.
After reading all the datasheets, UMs and so on and after trying the given samplecode i want to write some simple code by my self. At the moment i'm able to define the GPIOs as outputs and change their values, so i can controle the on board LEDs.

My question is: How can i read the value of a GPIO to use him as input?

I use this method to write values to an output GPIO:

But there seems to be no mehtod to read the current value of a GPIO.
In examples for other uC i found the following code, but it does not work with the LPC1227:

In this moment i want one of the on board LEDs to shine by pressing one of the on board buttons, but at the end the button shall start the reading procedure of a NFC card.

I hope someone can help me solving this problem!

Many thanks in advance!