What does 1 << ( twint) mean?

Status
Not open for further replies.

dl09

Full Member level 4
Joined
Feb 12, 2020
Messages
226
Helped
2
Reputation
4
Reaction score
1
Trophy points
18
Activity points
1,692
If I write 1 << (twint) on an arduino ide, does that set or clear the twi interrupt flag of the twi control register? I tried researching on the internet, I cannot find an answer.
 

If I write 1 << (twint) on an arduino ide,
does that set or clear the twi interrupt flag
of the twi control register? I tried researching on the internet,
I cannot find an answer.

the operation clears bitno_0 of the register.
 

Are you sure?
1 << (twint) shifts a '1' left by '(twint)' times, it creates a value but does it change the contents of a register?

Brian.
 

Are you sure?
1 << (twint) shifts a '1' left by '(twint)' times, it creates a value but does it change the contents of a register?

Brian.

Honestly I don't know what it does.
 

1 << (twint) shifts a '1' left by '(twint)' times, it creates a value but does it change the contents of a register?

You are right; it does nothing because the contents are not assigned a location. I think the result will be left into the accumulator and discarded.

You need an assignment statement: x=1<<2; (or something like that); it can also be part of another expression.
 

Honestly I don't know what it does.

If you don't know, just click on Help -> Reference and, if you are lucky, you will find this page:

file:///home/zasto/arduino-1.8.12/reference/www.arduino.cc/en/Reference/Bitshift.html

Don't be shy to consult Help
 

Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…