CE on NRF24L01--must be zero to receive data on SPI?

That code works because it calls the FLUSH_RX command [rx_send_byte(0xE2); //Flush RX FIFO]. If you keep CE high while you read out a payload with the R_RX_PAYLOAD command, the L01 (for whatever reason) doesn’t remove that packet from the RX FIFO. Therefore, to get rid of the just-read payload, you have to call the FLUSH_RX command. The problem with doing it this way is that, if there are any other payloads in your RX FIFO, they get flushed, too.

It’s possible this was fixed in the L01+. I haven’t tested it since I started working with the L01, so I’m not sure. The easy way to test this is to comment out the FLUSH_RX command in the code above, then read FIFO_STATUS.RX_EMPTY (register 0x17, bit 0) after you’ve read out the RX payload (be sure to leave CE high the entire time). If RX_EMPTY is 0 after the RX payload has been read, then the issue is fixed and the device will now remove payloads from the RX FIFO even if CE is high. If this bit is a 1, then you still either have to flush the RX FIFO if you’re leaving CE high, or you can bring CE low while reading the payload and the device will remove the payload from the RX FIFO automatically. Be absolutely sure that whatever device is sending the payload only sends one payload, or else your RX FIFO could have two legitimate packets in it and the test results will be wrong.