I'm trying to take a 16 bit unsigned integer from a structure, mask the first 8 bits of it, and use it as an index to an array with the function analogWrite which takes the output pin on the Arduino and the output byte as arguments. The code in question looks something like this: analogWrite(outputPin, my_array[myStructure->data & 0xFF00 >> 8]);
Unfortunately, this code doesn't work. I always get zero as an output. Any ideas?