liamNissan
Member
Hi I am trying to get direct port manipulation working. I have looked at other threads on it and read through the documentation for the K20P64M72SF1RM. I have tried just to get the led on pin 13 blinking using the port manipulation but it is not working. I know that the port for pin 13 is port c and the 5th pin on it but it still doesn't work. Is there anything that is wrong in my code? Thanks for any help.
Code:
int led = 5;
void setup() {
GPIOC_PDDR = (1<<led);//configuring the pin as an output
}
void loop() {
delay(1000);
GPIOC_PSOR = (1<<led);//setting the pin high
delay(1000);
GPIOC_PCOR = (1<<led);//setting the pin low
}