Arduino To Microsoft Excel Communication Using PLX-DAX.: Serial - Begin (9600)
Arduino To Microsoft Excel Communication Using PLX-DAX.: Serial - Begin (9600)
For example, measure temperature data with your Arduino, send the
results to Excel every 2 seconds, printed the data on a sheet and draw a
graph with all information. All communication will be done by
Serial.println commands just like the commands you use to send from
Arduino to monitor in your Arduino IDE Serial Monitor.
a. Port: set to Arduino port (same as in Arduino IDE => Tools => Port,
e.g., 4 for COM4.
b. Baud: set to the baud rate you run your Arduino on (e.g., 9600 if
you are using Serial.begin(9600); in your Arduino code).
c. Connect: connects to your Arduino and starts logging.
2- Write a program to read the temperature and humidity from the sensor
and display the results on the Excel sheet using PLX DAC.
Code
#include <dht.h>
dht DHT;
#define DHT11_PIN 7
void setup(){
Serial.begin(9600);
Serial.println("CLEARDATA");
Serial.println("LABEL,Date,Time,Temp,Hum");
}
void loop()
{
delay(1500); //delay to complete the measurements
DHT.read11(DHT11_PIN); //read from DHT11
float t=DHT.temperature;
float h=DHT.humidity;
Serial.print( (String) "DATA,DATE,TIME,");
Serial.print(t); //print temprature
Serial.print(",");
Serial.println(h); //print humidity
}
Figure 3: The results