cancel
Showing results for 
Search instead for 
Did you mean: 

How to find out the address of LED?

DK.7
Senior

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)".

3 REPLIES 3
Uwe Bonnes
Principal III

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.

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.

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