I am trying to achieve the following:
check if there is no data on the serial port, start the timer for 30 mins. If during this time, there is no data that is transferred to/from the serial port, turn off all the gpio pins on arduino. If the data is transferred then restart the timer and wait for another 30 mins.
I am stuck on how to check if there is data being transferred on the serial port. Is there a way to do this?