This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CLEAR_BIT and SET_BIT

Hi,

I want to learn how to use "CLEAR_BIT and SET_BIT".

Could you please give me some example to set/clear bit using above code?

All the best,
Mehmet

Parents
  • So - how to set a single bit in a byte? Isn't that a part of the C language course you are taking?

    And why do you need it for your own variables, if you already have HAL_xx() functions to operate on the actual GPIO pins?

    Another thing - you don't think it's a good thing to use your while statement with a {} around the body? And who will ever known the meaning of variables named "a" and "b"? The variable names would possibly be meaningful if they stored the number of "a" and "b" found in a text file.

Reply
  • So - how to set a single bit in a byte? Isn't that a part of the C language course you are taking?

    And why do you need it for your own variables, if you already have HAL_xx() functions to operate on the actual GPIO pins?

    Another thing - you don't think it's a good thing to use your while statement with a {} around the body? And who will ever known the meaning of variables named "a" and "b"? The variable names would possibly be meaningful if they stored the number of "a" and "b" found in a text file.

Children
No data