Home > Mobile >  Sending input to GPIOC
Sending input to GPIOC

Time:12-23

I'm trying to send input to the pressing button (GPIOC 1<<13) however I get an error that my statement is incorrect. that's what I tried to run:

HAL_UART_Transmit(GPIOC->IDR & (1<<13)), (uint8_t*)"Hello World\r\n", 16, 100); // Prints to the debugger's UART "Hello World"

and I keep getting "expected statement before ‘)’ token"

any help will be appreciated

Thanks

CodePudding user response:

You put an extra ) after (1 << 13), correct line would be:

HAL_UART_Transmit(GPIOC->IDR & (1<<13), (uint8_t*)"Hello World\r\n", 16, 100);
  • Related