Closed S-Prato closed 3 years ago
Certainly, your question is not related to any issue with this library. However, you can read inputs (switches) with something similar to the following code snippet:
if( HAL_GPIO_ReadPin(GPIOA, 3))
{
ModbusDATA[0] | = 1<<3; // set
}
else
{
ModbusDATA[0] & = ~ (1<<3); //clear
}
ModbusDATA is the array used as part of the Modbus configuration, check that on the main.c file of the examples.
Hi,
I'm new to stm32 programming and in general my knowledge is limited to basic university C courses. My question could be stupid, in that case feel free to close the issue. I can read and write coils through a master simulator but I would like to set coils ON or OFF based on inputs (switches) on the stm32 board. Is this possible? I basically would like to make a keyboard.