@promanaid wrote:
now using the case of sending the number 5 only which brings the readings of all sensors (which you modified for me). If i understand correctly the read operation ends with the linefeed that i put in the end which is what i need. Anyway i tried adding the println afterf every 3 readings and it didn't make a difference.
In your code, if p=5, then nothing happens. You don't have any commands in that elseIF.