I’m having little trouble with using binary and bitwise operator to make led work. I"m using inputs 2,3,4,5 and trying to turn it on by following mechanism.
Below is the general skeleton code I’ve created using bitwise operator. But how do I apply this to digitalWrite??? I need help.
int pattern=1, shift;
if (index<4) shift = index;
else shift = 6-index;