Skip to main content
Graduate II
January 7, 2022
Question

How to find out the address of LED?

  • January 7, 2022
  • 1 reply
  • 1267 views

I'm studying a Modbus...

And i wanna to check my code and I want to check the condition of pin PC13 (LED).

How to find out the address of pin C13?

If this line

printf("Address of variable LED is: %p\r\n", &LED);

say to me error "'LED' undeclared (first use in this function)".

    This topic has been closed for replies.

    1 reply

    Graduate II
    January 7, 2022

    There is no address of the LED, LED is connected to a GPIO pins and LED is a define not an address. This define is than argument to several function that manipulate the state of the LED.

    DK.7Author
    Graduate II
    January 7, 2022

    Thank you for answer! Then how can I find out the condition of LED with Modbus?

    I need to specify the start address in the simulator Modbus master.

    see screen.

    Graduate II
    January 7, 2022

    You need some task in your controller that read the LED state and translates it to Modbus.