QUB-ASL / bzzz

Quadcopter with ESP32 and RaspberryPi
MIT License
7 stars 1 forks source link

Fixed logical error in readPiData function #64

Closed patchedByBatman closed 1 year ago

patchedByBatman commented 1 year ago

Main Changes

There was a logical mistake in readPiData function in radio.cpp. The error got fixed.

The for loop was supposed to be for (int i = 0; i < NUM_RADIO_CHANNELS && allDataFromPi != ""; i++, data_count++) instead of for (int i = 0; i < NUM_RADIO_CHANNELS || allDataFromPi != ""; i++, data_count++)

patchedByBatman commented 1 year ago

This code is tested just now.

patchedByBatman commented 1 year ago

Chandra, thanks for fixing this. I'm just wondering about the thread that prints out the output of ESP. I guess the idea is that if we want to deactivate the printing (e.g., when flying) we need to do so on the ESP; is that right?

Yes, professor. The Pi just checks if data is available via serial.