Hi! Can you please help me with my code?
#include <SFE_BMP180.h>
#include <FastLED.h>
#include <Wire.h>
#include <SFE_BMP180.h>
SFE_BMP180 BMP180;
const int buzzer = 9; //buzzer to arduino pin 9
const int ledPin = 13;
const int ldrPin = A0;
#define LED_PIN 7
#define NUM_LEDS 20
CRGB leds[NUM_LEDS];
void setup() {
Serial.begin(9600);
bool success = BMP180.begin();
if (success) {
Serial.println("BMP180 init success");
}
{ pinMode(buzzer, OUTPUT); // Set buzzer - pin 9 as an output
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(ldrPin, INPUT);
// put your setup code here, to run once:
pinMode(10,OUTPUT);
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
}
void loop() {
{
{
tone(buzzer, 1000); // Send 1KHz sound signal...
delay(1000); // ...for 5 sec
noTone(buzzer); // Stop sound...
delay(30000); // ...for 30 sec
}
int ldrStatus = analogRead(ldrPin);
if (ldrStatus <= 400)
{
digitalWrite(ledPin, HIGH);
Serial.print("Its Dark, Turn on the LED:");
Serial.println(ldrStatus);
}
else
{
digitalWrite(ledPin, LOW);
Serial.print("Its Bright, Turn off the LED:");
Serial.println(ldrStatus);
}
// put your main code here, to run repeatedly:
digitalWrite(10,HIGH);
delay(1000);
digitalWrite(10,LOW);
char status;
double T, P;
bool success = false;
status = BMP180.startTemperature();
int PressureValve;
if (status != 0) {
delay(1000);
status = BMP180.getTemperature(T);
if (status != 0) {
status = BMP180.startPressure(3);
if (status != 0) {
delay(status);
status = BMP180.getPressure(P,T);
if (status != 0) {
Serial.print("Pressure: ");
Serial.print(P);
Serial.println(" hPa");
Serial.print("Temperature: ");
Serial.print(T);
Serial.println(" C");
(PressureValve =("Pressure: ")
if (PressureValve = < 1007.00 hPa)
{
"led[0] = CRGB(255, 0, 0)";
FastLED.show();
delay(0); // do stuff if the condition is false
Serial.println("OFF LED");
}
else ("Pressure > = 1010.00 hPa" )
{
digitalWrite(10,HIGH);
delay(5000);
digitalWrite(10,LOW); // do stuff if the condition is true
Serial.println("ON LED");
}
}
}
}
}
}
}
Here are my errors :
(PressureValve =("Pressure: ")
^
Testing:98: error: expected ')' before 'if'
if () (PressureValve = < 1007.00 hPa)
^
Testing:106: error: expected ';' before 'else'
else ("Pressure > = 1010.00 hPa" )
^
exit status 1
expected ')' before 'if'