# Bit() correct syntax

**URL:** <https://forum.arduino.cc/t/bit-correct-syntax/1240790>\
**Category:** Programming\
**Created:** [March 27, 2024, 10:22pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790 "2024-03-27T22:22:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kavala](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kavala/32/1204998_2.png) [@kavala](https://forum.arduino.cc/u/kavala)\
**Post date:** [March 27, 2024, 10:22pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/1 "2024-03-27T22:22:25Z")

</div>

What is the syntax for this instruction.

bit(n) of what ?

There must be another argument. I've tried several formats. None worked.  
There don't seem to be any examples.

Obviously, there are other ways to do this, but I was curious as to the correct  
syntax ?

---

<div class="post-metadata">

**Author:** ![ruilviana](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ruilviana/32/722429_2.png) [@ruilviana](https://forum.arduino.cc/u/ruilviana)\
**Post date:** [March 27, 2024, 10:23pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/2 "2024-03-27T22:23:40Z")

</div>

> **[bit() - Arduino Reference](https://www.arduino.cc/reference/en/language/functions/bits-and-bytes/bit/)**
>
> The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.

---

<div class="post-metadata">

**Author:** ![ruilviana](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ruilviana/32/722429_2.png) [@ruilviana](https://forum.arduino.cc/u/ruilviana)\
**Post date:** [March 27, 2024, 10:25pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/3 "2024-03-27T22:25:28Z")

</div>

```arduino
void setup() {
  Serial.begin(9600); // opens serial port, sets data rate to 9600 bps

  long x;

  for (int n = 0; n < 16; n++) {
    x = bit(n); // equivalent to x = 1 << n;
    Serial.println(x, BIN);
  }
}

void loop() {

```

---

<div class="post-metadata">

**Author:** ![oldcurmudgeon](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/oldcurmudgeon/32/1280882_2.png) [@oldcurmudgeon](https://forum.arduino.cc/u/oldcurmudgeon)\
**Post date:** [March 27, 2024, 10:27pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/4 "2024-03-27T22:27:09Z")

</div>

It returns the value of the bit 2^n where bit n is the specified bit. For example bit(3) = 2^3 or 8. What did you think it did?

---

<div class="post-metadata">

**Author:** ![alto777](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/alto777/32/317385_2.png) [@alto777](https://forum.arduino.cc/u/alto777)\
**Post date:** [March 27, 2024, 10:41pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/5 "2024-03-27T22:41:16Z")

</div>

Maybe you are thinking it is one of these

[bitClear()](https://www.arduino.cc/reference/en/language/functions/bits-and-bytes/bitclear/)  
[bitRead()](https://www.arduino.cc/reference/en/language/functions/bits-and-bytes/bitread/)  
[bitSet()](https://www.arduino.cc/reference/en/language/functions/bits-and-bytes/bitset/)

which do take two arguments, something to operate upon, and a bit number.

Note that the result is the returned value, the argument is not changed.

HTH

a7

---

<div class="post-metadata">

**Author:** ![kavala](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kavala/32/1204998_2.png) [@kavala](https://forum.arduino.cc/u/kavala)\
**Post date:** [March 27, 2024, 11:09pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/6 "2024-03-27T23:09:09Z")

</div>

I know what it does....That wasn't my question...

---

<div class="post-metadata">

**Author:** ![kavala](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kavala/32/1204998_2.png) [@kavala](https://forum.arduino.cc/u/kavala)\
**Post date:** [March 27, 2024, 11:29pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/8 "2024-03-27T23:29:50Z")

</div>

Yes, but there is an argument missing.  
Bit 'n' of **what BYT** E is my question  
bit(n) only takes one argument.

---

<div class="post-metadata">

**Author:** ![kavala](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kavala/32/1204998_2.png) [@kavala](https://forum.arduino.cc/u/kavala)\
**Post date:** [March 27, 2024, 11:31pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/9 "2024-03-27T23:31:46Z")

</div>

Delta\_G. Bit 2 is the 3rd bit.

---

<div class="post-metadata">

**Author:** ![GolamMostafa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/golammostafa/32/239011_2.png) [@GolamMostafa](https://forum.arduino.cc/u/GolamMostafa)\
**Post date:** [March 27, 2024, 11:34pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/10 "2024-03-27T23:34:58Z")

</div>

> [@kavala](#):
>
> bit(n) of what ?

Assume:  
`byte m = 0b10101010; //b7, b6, ..., b1, b0`

In the above, every bit has --

```arduino
Positional Factor (PF),
Positional Weight )PW), and 
Positional Value (PV).

```

For example:  
For bit-3 (b3): //n = 3

```arduino
Positional Factor (PF) = 1
Positional Weight (PW) = 2^3 = 8
Positional Value (PV) = PF x PW = 1 x 8 = 8

```

_bit(n)_ computes/returns the **Positional Weight** of _n-th_ bit; where, _n = 0 refers to b0_, \*n = 1 refers to b1 \* etc.

**Test Sketch:**

```arduino
void setup()
{
  Serial.begin(9600);
  Serial.print(bit(3), DEC); //shows: 8 = PW of b3
}

void loop() {}

```

---

<div class="post-metadata">

**Author:** ![kavala](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kavala/32/1204998_2.png) [@kavala](https://forum.arduino.cc/u/kavala)\
**Post date:** [March 27, 2024, 11:51pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/11 "2024-03-27T23:51:00Z")

</div>

I don't need lessons on bits and bytes thanks.  
My question is syntactical.  
You are all missing the point. bit(n) only takes one argument, so answer me,  
"which byte or variable is the bit in question coming from" ?

Strangely enough, this compiles...

```arduino
x = bit(0), y;

```

---

<div class="post-metadata">

**Author:** ![van\_der\_decken](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/van_der_decken/32/1006976_2.png) [@van\_der\_decken](https://forum.arduino.cc/u/van_der_decken)\
**Post date:** [March 28, 2024, 12:09am UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/12 "2024-03-28T00:09:46Z")

</div>

Your question was succinctly answered by @Delta_G back in [post 7](https://forum.arduino.cc/t/bit-correct-syntax/1240790/7).

> [@Delta\_G](#):
>
> All bit(n) is is a shorthand for ((byte)1\<\<n)

---

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [March 28, 2024, 12:43am UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/15 "2024-03-28T00:43:44Z")

</div>

> [@kavala](#):
>
> My question is syntactical.  
> You are all missing the point. bit(n) only takes one argument, so answer me,  
> "which byte or variable is the bit in question coming from" ?

It's shorthand for "the numeric value when bit N set (and all other bits in the value are 0)"  
No additional arguments required.  
It's more like the `0x` prefix than an actual function.

---

<div class="post-metadata">

**Author:** ![kavala](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kavala/32/1204998_2.png) [@kavala](https://forum.arduino.cc/u/kavala)\
**Post date:** [March 28, 2024, 1:52am UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/16 "2024-03-28T01:52:03Z")

</div>

I'm with ya now Delta\_G. You were talking about powers of 2, not bit position.

---

<div class="post-metadata">

**Author:** ![kavala](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kavala/32/1204998_2.png) [@kavala](https://forum.arduino.cc/u/kavala)\
**Post date:** [March 28, 2024, 1:55am UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/17 "2024-03-28T01:55:29Z")

</div>

bit N of what ??  
There is no byte specified in the call ???

---

<div class="post-metadata">

**Author:** ![kavala](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kavala/32/1204998_2.png) [@kavala](https://forum.arduino.cc/u/kavala)\
**Post date:** [March 28, 2024, 2:27am UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/19 "2024-03-28T02:27:53Z")

</div>

Ah yes, I think I get it now.

I was assuming bit(n) was returning the value of the bit at position 'n'.  
i.e Is bit n a 0 or a 1. Therefore you would need to supply a second argument.

However, I now see it is simply a lookup returning the actual numeric value of 2^n.

Thanks guys for clearing that up.

---

<div class="post-metadata">

**Author:** ![gfvalvo](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gfvalvo/32/1013044_2.png) [@gfvalvo](https://forum.arduino.cc/u/gfvalvo)\
**Post date:** [March 28, 2024, 2:37am UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/20 "2024-03-28T02:37:45Z")

</div>

> [@kavala](#):
>
> I don't need lessons on bits and bytes thanks.

Kind of a bad attitude given how things turned out.

> [@kavala](#):
>
> Strangely enough, this compiles...
> 
> ```arduino
> x = bit(0), y;
> 
> ```

[Comma Operator](https://www.tutorialspoint.com/cplusplus/cpp_comma_operator.htm).

---

<div class="post-metadata">

**Author:** ![DaveX](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/davex/32/751443_2.png) [@DaveX](https://forum.arduino.cc/u/DaveX)\
**Post date:** [March 28, 2024, 3:08am UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/21 "2024-03-28T03:08:17Z")

</div>

```arduino
bit( 0): 0b00000000000000000000000000000000 00000000000000000000000000000001
bit( 1): 0b00000000000000000000000000000000 00000000000000000000000000000010
bit( 2): 0b00000000000000000000000000000000 00000000000000000000000000000100
bit( 3): 0b00000000000000000000000000000000 00000000000000000000000000001000
bit( 4): 0b00000000000000000000000000000000 00000000000000000000000000010000
bit( 5): 0b00000000000000000000000000000000 00000000000000000000000000100000
bit( 6): 0b00000000000000000000000000000000 00000000000000000000000001000000
bit( 7): 0b00000000000000000000000000000000 00000000000000000000000010000000
bit( 8): 0b00000000000000000000000000000000 00000000000000000000000100000000
bit( 9): 0b00000000000000000000000000000000 00000000000000000000001000000000
bit(10): 0b00000000000000000000000000000000 00000000000000000000010000000000
bit(11): 0b00000000000000000000000000000000 00000000000000000000100000000000
bit(12): 0b00000000000000000000000000000000 00000000000000000001000000000000
bit(13): 0b00000000000000000000000000000000 00000000000000000010000000000000
bit(14): 0b00000000000000000000000000000000 00000000000000000100000000000000
bit(15): 0b00000000000000000000000000000000 00000000000000001000000000000000
bit(16): 0b00000000000000000000000000000000 00000000000000010000000000000000
bit(17): 0b00000000000000000000000000000000 00000000000000100000000000000000
bit(18): 0b00000000000000000000000000000000 00000000000001000000000000000000
bit(19): 0b00000000000000000000000000000000 00000000000010000000000000000000
bit(20): 0b00000000000000000000000000000000 00000000000100000000000000000000
bit(21): 0b00000000000000000000000000000000 00000000001000000000000000000000
bit(22): 0b00000000000000000000000000000000 00000000010000000000000000000000
bit(23): 0b00000000000000000000000000000000 00000000100000000000000000000000
bit(24): 0b00000000000000000000000000000000 00000001000000000000000000000000
bit(25): 0b00000000000000000000000000000000 00000010000000000000000000000000
bit(26): 0b00000000000000000000000000000000 00000100000000000000000000000000
bit(27): 0b00000000000000000000000000000000 00001000000000000000000000000000
bit(28): 0b00000000000000000000000000000000 00010000000000000000000000000000
bit(29): 0b00000000000000000000000000000000 00100000000000000000000000000000
bit(30): 0b00000000000000000000000000000000 01000000000000000000000000000000
bit(31): 0b00000000000000000000000000000000 10000000000000000000000000000000
bit(32): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(33): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(34): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(35): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(36): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(37): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(38): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(39): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(40): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(41): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(42): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(43): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(44): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(45): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(46): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(47): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(48): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(49): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(50): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(51): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(52): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(53): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(54): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(55): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(56): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(57): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(58): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(59): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(60): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(61): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(62): 0b00000000000000000000000000000000 00000000000000000000000000000000
bit(63): 0b00000000000000000000000000000000 00000000000000000000000000000000
1ULL<< 0: 0b00000000000000000000000000000000 00000000000000000000000000000001
1ULL<< 1: 0b00000000000000000000000000000000 00000000000000000000000000000010
1ULL<< 2: 0b00000000000000000000000000000000 00000000000000000000000000000100
1ULL<< 3: 0b00000000000000000000000000000000 00000000000000000000000000001000
1ULL<< 4: 0b00000000000000000000000000000000 00000000000000000000000000010000
1ULL<< 5: 0b00000000000000000000000000000000 00000000000000000000000000100000
1ULL<< 6: 0b00000000000000000000000000000000 00000000000000000000000001000000
1ULL<< 7: 0b00000000000000000000000000000000 00000000000000000000000010000000
1ULL<< 8: 0b00000000000000000000000000000000 00000000000000000000000100000000
1ULL<< 9: 0b00000000000000000000000000000000 00000000000000000000001000000000
1ULL<<10: 0b00000000000000000000000000000000 00000000000000000000010000000000
1ULL<<11: 0b00000000000000000000000000000000 00000000000000000000100000000000
1ULL<<12: 0b00000000000000000000000000000000 00000000000000000001000000000000
1ULL<<13: 0b00000000000000000000000000000000 00000000000000000010000000000000
1ULL<<14: 0b00000000000000000000000000000000 00000000000000000100000000000000
1ULL<<15: 0b00000000000000000000000000000000 00000000000000001000000000000000
1ULL<<16: 0b00000000000000000000000000000000 00000000000000010000000000000000
1ULL<<17: 0b00000000000000000000000000000000 00000000000000100000000000000000
1ULL<<18: 0b00000000000000000000000000000000 00000000000001000000000000000000
1ULL<<19: 0b00000000000000000000000000000000 00000000000010000000000000000000
1ULL<<20: 0b00000000000000000000000000000000 00000000000100000000000000000000
1ULL<<21: 0b00000000000000000000000000000000 00000000001000000000000000000000
1ULL<<22: 0b00000000000000000000000000000000 00000000010000000000000000000000
1ULL<<23: 0b00000000000000000000000000000000 00000000100000000000000000000000
1ULL<<24: 0b00000000000000000000000000000000 00000001000000000000000000000000
1ULL<<25: 0b00000000000000000000000000000000 00000010000000000000000000000000
1ULL<<26: 0b00000000000000000000000000000000 00000100000000000000000000000000
1ULL<<27: 0b00000000000000000000000000000000 00001000000000000000000000000000
1ULL<<28: 0b00000000000000000000000000000000 00010000000000000000000000000000
1ULL<<29: 0b00000000000000000000000000000000 00100000000000000000000000000000
1ULL<<30: 0b00000000000000000000000000000000 01000000000000000000000000000000
1ULL<<31: 0b00000000000000000000000000000000 10000000000000000000000000000000
1ULL<<32: 0b00000000000000000000000000000001 00000000000000000000000000000000
1ULL<<33: 0b00000000000000000000000000000010 00000000000000000000000000000000
1ULL<<34: 0b00000000000000000000000000000100 00000000000000000000000000000000
1ULL<<35: 0b00000000000000000000000000001000 00000000000000000000000000000000
1ULL<<36: 0b00000000000000000000000000010000 00000000000000000000000000000000
1ULL<<37: 0b00000000000000000000000000100000 00000000000000000000000000000000
1ULL<<38: 0b00000000000000000000000001000000 00000000000000000000000000000000
1ULL<<39: 0b00000000000000000000000010000000 00000000000000000000000000000000
1ULL<<40: 0b00000000000000000000000100000000 00000000000000000000000000000000
1ULL<<41: 0b00000000000000000000001000000000 00000000000000000000000000000000
1ULL<<42: 0b00000000000000000000010000000000 00000000000000000000000000000000
1ULL<<43: 0b00000000000000000000100000000000 00000000000000000000000000000000
1ULL<<44: 0b00000000000000000001000000000000 00000000000000000000000000000000
1ULL<<45: 0b00000000000000000010000000000000 00000000000000000000000000000000
1ULL<<46: 0b00000000000000000100000000000000 00000000000000000000000000000000
1ULL<<47: 0b00000000000000001000000000000000 00000000000000000000000000000000
1ULL<<48: 0b00000000000000010000000000000000 00000000000000000000000000000000
1ULL<<49: 0b00000000000000100000000000000000 00000000000000000000000000000000
1ULL<<50: 0b00000000000001000000000000000000 00000000000000000000000000000000
1ULL<<51: 0b00000000000010000000000000000000 00000000000000000000000000000000
1ULL<<52: 0b00000000000100000000000000000000 00000000000000000000000000000000
1ULL<<53: 0b00000000001000000000000000000000 00000000000000000000000000000000
1ULL<<54: 0b00000000010000000000000000000000 00000000000000000000000000000000
1ULL<<55: 0b00000000100000000000000000000000 00000000000000000000000000000000
1ULL<<56: 0b00000001000000000000000000000000 00000000000000000000000000000000
1ULL<<57: 0b00000010000000000000000000000000 00000000000000000000000000000000
1ULL<<58: 0b00000100000000000000000000000000 00000000000000000000000000000000
1ULL<<59: 0b00001000000000000000000000000000 00000000000000000000000000000000
1ULL<<60: 0b00010000000000000000000000000000 00000000000000000000000000000000
1ULL<<61: 0b00100000000000000000000000000000 00000000000000000000000000000000
1ULL<<62: 0b01000000000000000000000000000000 00000000000000000000000000000000
1ULL<<63: 0b10000000000000000000000000000000 00000000000000000000000000000000

```

from

```arduino
#include <LibPrintf.h>

void setup() {
  Serial.begin(115200);
  for ( int i = 0; i < 64 ; ++i) {
    uint64_t j = 1ULL;
    j = bit(i); // only works to 31
    printf("bit(%2i): 0b%032lb %032lb\n", i, uint32_t(j >> 32), uint32_t(j & 0xFFFFFFFF) );
  }
  for ( int i = 0; i < 64 ; ++i) {
    uint64_t j = 1ULL;
    j = 1ULL<<i; // works to 63
    printf("1ULL<<%2i: 0b%032lb %032lb\n", i, uint32_t(j >> 32), uint32_t(j & 0xFFFFFFFF) );
  }  
}

void loop() {
}

```

---

<div class="post-metadata">

**Author:** ![alto777](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/alto777/32/317385_2.png) [@alto777](https://forum.arduino.cc/u/alto777)\
**Post date:** [March 28, 2024, 4:37pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/23 "2024-03-28T16:37:10Z")

</div>

> [@kavala](#):
>
> I was assuming bit(n) was returning the value of the bit at position 'n'.

_Of what_? LOL.

This should have been all done with post #2. Or 3. Or 4. Or 7. Hours ago.

It's easy I guess to get stuck on an idea of what must be, and simply ignore responses, documentation and code examples.

a7

---

<div class="post-metadata">

**Author:** ![GolamMostafa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/golammostafa/32/239011_2.png) [@GolamMostafa](https://forum.arduino.cc/u/GolamMostafa)\
**Post date:** [March 28, 2024, 4:48pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/24 "2024-03-28T16:48:12Z")

</div>

> [@kavala](#):
>
> Strangely enough, this compiles...
> 
> ```arduino
> x = bit(0), y;
> 
> ```

Does not compile for me in Arduino UNO?

```arduino
void setup() 
{
  Serial.begin(9600);
  byte y = 0b10101010;
  byte x = bit(0), y;
  Serial.println(x, DEC);
}

void loop() {}

```

---

<div class="post-metadata">

**Author:** ![GolamMostafa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/golammostafa/32/239011_2.png) [@GolamMostafa](https://forum.arduino.cc/u/GolamMostafa)\
**Post date:** [March 28, 2024, 5:03pm UTC](https://forum.arduino.cc/t/bit-correct-syntax/1240790/26 "2024-03-28T17:03:04Z")

</div>

Yes! I read the error message -- redeclaration of 'byte y'.

I have declared 'y' only once in post #24; so, I ignored the above error message; instead, I am wandering to see in what way the following statement is wrong.  
`byte x = bit(0), y;`

[Next page](https://forum.arduino.cc/t/bit-correct-syntax/1240790.md?page=2)
