Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Sending input to GPIOC

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Thanks

>Solution :

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);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading