My understanding is that reading data from an SPI slave device goes like this:
uint8_t derp;
derp = SPI.transfer(0);
where a zero is "transferred" to the device, because it'll ignore anything that doesn't begin with a 0x7E, and will assign whatever is in the SPI receive register to the variable. Is that not the case here?
val = SPI.transfer(0); // within 300 tries, then abort
my intent was to have the uint8_t val assigned the contents of the SPI receive register for each loop. The variable contents are used to drive a for-loop that continues looking for a 0x7E for 300 cycles.
#ifdef DEBUG
usb.println(val,HEX);
#endif
My apologies, at the beginning of my code I #define Serial as usb...to save keystrokes and to help me keep up with the various serial outputs of the MEGA.