This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Set Pin to high

Hello,

I want to set a GPIO Pin to high. Therefore I wrote the code below.

But when the software is written onto the nrf52811, I can not messure any voltage.

I do not want to use any library or external file for this.

//start of code

int main()
{

unsigned int base = 0x50000000; //base adress of GPIO
unsigned int out = 0x504; //offset
unsigned int outAdress = base + out;// adress of OUT Register

unsigned int write = 1; //set first Pin to high
unsigned int *point = outAdress; //Pointer on outAdress

*point = write; //set outAdress to 0000 0000 0000 0000 0000 0000 0000 0001

while(1)
{
    //do nothing
}
}

//end of code

Thank you for your help.

Related