I want to send data from arduino to computer by using serial. Then i want to record the time based on the current timestamp and i save it in the txt file. What should I do? Your suggestions are very useful to me.
this my code on arduino:
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup(){
Serial.begin(9600);
dht.begin();
}
void loop(){
float hum = dht.readHumidity();
float temp= dht.readTemperature();
Serial.print("Humidity: ");
Serial.print(hum);
Serial.print(" %, Temp: ");
Serial.print(temp);
Serial.println(" Celsius");
delay(2000);
}