I am trying this on an Arduino Mega.
I get some unexpected results shifting a bit in a 32bit value;
My initial goal was to 'emulate' an array of 24 booleans. I was hoping to store them in one unsigned Long. It all worked well but got some unexpected results, that is why I wrote this little script to test the error...
That line shifts a 1 of type "int" left by "s" bits. "int" is only 16 bits wide on many of the Arduinos. Change "1" to "1UL" to make it an unsigned long to match "LongVar1".
That line shifts a 1 of type "int" left by "s" bits. "int" is only 16 bits wide on many of the Arduinos. Change "1" to "1UL" to make it an unsigned long to match "LongVar1".