Updated with SetInterval to send data at a prescribed interval