I found someone expained"
Clear - output set to LOW
Set - output set to HIGH
Toggle - output set to opposite of current state."
I still can't understand,sepecially" opposite of current state".What's the meaning of that?
I also want to know the meaning of "0b" in the code "TCCR0A = 0b01000010".
kolaha
April 27, 2022, 12:24pm
2
if state is 1 it will be cleared to 0, if state is 0 it will be set to 1.
yijinyyds:
"0b"
means following digits are binary number
1 Like
Toggle will turn LOW into HIGH or HIGH into LOW. Also known as XOR or eXclusive OR. "0b" is a prefix for binary numbers.
int value = 0b00000010; //value = 2
value = value xor 2; //value = 0
value = value xor 2; //value = 2
In C xor is usually written as "^": value = value ^ 2
or the short version: value ^= 2
1 Like
gcjr
April 27, 2022, 1:09pm
4
preceding bits are binary. 100b = 8
Thanks for your answer! I found a kind of statement asfollows
"A FOC0A strobe will not generate any interrupt, nor will it clear the timer in CTC mode using OCR0A as TOP. "
is the meanig of"clear the timer" "Clear the data of the counter"?
system
Closed
October 24, 2022, 1:18pm
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.