ikkrm
1
It says "expected primary-expression before '.' token" i couldnt find the wrong can you help me?
#include <DHT.h>
#include <LedControl.h>
#define DHTPIN 2
#define DHTTYPE DHT11
int DIN = 12;
int CS = 11;
int CLK = 10;
LedControl lc=LedControl(DIN,CLK,CS,0);
int buzzerPin=2;
void setup() {
lc.shutdown(0,false);
lc.setIntensity(0,15);
lc.clearDisplay(0);
Serial.begin(9600);
pinMode(buzzerPin, OUTPUT);
delay(5000);
}
void loop() {
byte A[8]= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
byte B[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
int s=(DHT.read temperature);
Serial.print(s);
if(s>25){
digitalWrite(buzzerPin, HIGH);
printByte(A);
}
{tone(2,1000);
delay(100);
noTone(2);
delay(1000);
}
else{digitalWrite(2, LOW);
printByte(B);
}}
}
You forgot the ";" at the end of "digitalWrite(buzzerPin, HIGH)" in your loop. That is a common mistake , pay attention ; )
ikkrm
3
I fixed it but its still says same
the end of your code is also a bit screwy.
I would rewrite it like this :
void loop() {
byte A[8]= {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
byte B[8]= {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
int s=(DHT.read temperature);
Serial.print(s);
if(s>25){
digitalWrite(buzzerPin, HIGH)
printByte(A);
tone(2,1000);
delay(100);
noTone(2);
delay(1000);
}
else{
digitalWrite(2, LOW);
printByte(B);
}
}
if it still doesn't work, tell me on which line the error message is printed
ikkrm
5
Its still same error and same line
We can't see your code.
We can't see your error message(s)
ikkrm:
Please help me
The IDE has highlighted the problem.
Look carefully at your code, then at the example code for the DHT library.
In future, please post code, NOT pictures of code.