I'm trying to use this code to get temperature and humidity values from DHT11 sensor and send it to Python and I need to write the temperature and humidity values in the same line. But I keep getting the error code
expected primary-expression before '%' token
How can I fix this?
#include <dht.h>
#include <stdio.h>
int a = 0;
int b = 0;
char buffer [64];
dht DHT;
#define DHT11_PIN 7
void setup(){
Serial.begin(9600);
}
void loop(){
a = DHT.temperature;
b = DHT.humidity;
int chk = DHT.read11(DHT11_PIN);
sprintf(buffer, %d %d, a, b);
Serial.print(buffer);
delay(1000);
}