Skip to main content
DK.7
Associate III
January 7, 2022
Question

How to find out the address of LED?

  • January 7, 2022
  • 3 replies
  • 1294 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.

3 replies

Uwe Bonnes
Chief
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.7
DK.7Author
Associate III
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.

Uwe Bonnes
Chief
January 7, 2022

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