Iam getting an error after compiling.iam using the latest arduino software
http://www.efymag.com/admin/issuepdf/Earthquake Detector Using Arduino.rar
http://www.efymag.com/admin/issuepdf/Earthquake Detector Using Arduino.rar
#include <EEPROM.h>
#include <EEPROM.h>
#include "EEPROMAnything.h"
#include <LiquidCrystal.h>
const int alarmPin = 5;
const int relayPin = 10;
int Xacc, Yacc, Zacc, threshold = 0, thresholdSET = 25;
long debouncing_time = 15; //Debouncing Time in Milliseconds
volatile unsigned long last_micros;
LiquidCrystal lcd(12, 11, 9, 8, 7, 6);
struct sensorValue
{
int X;
int Y;
int Z;
};
sensorValue acceleration;
void debounceInterrupt_Increment()
{
if ((long)(micros() - last_micros) >= debouncing_time * 1000) {
IncrementThreshold();
last_micros = micros();
}
}
void debounceInterrupt_Decrement()
{
if ((long)(micros() - last_micros) >= debouncing_time * 1000) {
DecrementThreshold();
last_micros = micros();
}
}
void IncrementThreshold() {
thresholdSET = EEPROM.read(500);
thresholdSET++;
EEPROM.write(500, thresholdSET);
}
void DecrementThreshold() {
thresholdSET = EEPROM.read(500);
thresholdSET--;
EEPROM.write(500, thresholdSET);
}
void setup() {
lcd.begin(16, 2);
attachInterrupt(0, debounceInterrupt_Increment, RISING);
attachInterrupt(1, debounceInterrupt_Decrement, RISING);
pinMode(alarmPin, OUTPUT);
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH);
EEPROM.write(500, thresholdSET);
digitalWrite(alarmPin, LOW);
lcd.setCursor(0, 0);
lcd.print("Initializing....");
delay(5000);
sensorValue acceleration = { analogRead(A0) , analogRead(A1) , analogRead(A2) };
EEPROM_writeAnything(0, acceleration);
EEPROM_readAnything(0, acceleration);
lcd.clear();
}
void loop() {
EEPROM_readAnything(0, acceleration);
threshold = EEPROM.read(500);
lcd.setCursor(0, 0);
lcd.print("Monitoring Mode");
lcd.setCursor(0,1);
lcd.print("Threshold = ");
lcd.print(threshold);
Xacc = analogRead(A0);
Yacc = analogRead(A1);
Zacc = analogRead(A2);
if ((Xacc >= (acceleration.X + threshold)) || (Xacc <= (acceleration.X - threshold))||(Yacc >= (acceleration.Y + threshold)) || (Yacc <= (acceleration.Y - threshold))||(Zacc >= (acceleration.Z + threshold)) || (Zacc <= (acceleration.Z - threshold))) {
digitalWrite(relayPin, LOW);
digitalWrite(alarmPin, HIGH);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("ALARM !!!!!");
lcd.setCursor(0,1);
lcd.print("PLEASE EVACUATE");
delay(5000);
digitalWrite(relayPin, HIGH);
digitalWrite(alarmPin, LOW);
lcd.clear();
}
}
Please include the error. My crystal ball is in the shop. Something with this much detail would be helpful:Im getting an EPROM error
In file included from sketch_jul13b.cpp:2:
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:2:46: error: Arduino.h: No such file or directory
In file included from sketch_jul13b.cpp:2:
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h: In function 'int EEPROM_writeAnything(int, const T&)':
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:6: error: expected initializer before '*' token
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:9: error: 'p' was not declared in this scope
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h: In function 'int EEPROM_readAnything(int, T&)':
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:15: error: 'byte' was not declared in this scope
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:15: error: 'p' was not declared in this scope
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:15: error: expected primary-expression before ')' token
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:15: error: expected primary-expression before 'void'
Please include the error. My crystal ball is in the shop. Something with this much detail would be helpful:Im getting an EPROM error
In file included from sketch_jul13b.cpp:2:
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:2:46: error: Arduino.h: No such file or directory
In file included from sketch_jul13b.cpp:2:
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h: In function 'int EEPROM_writeAnything(int, const T&)':
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:6: error: expected initializer before '*' token
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:9: error: 'p' was not declared in this scope
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h: In function 'int EEPROM_readAnything(int, T&)':
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:15: error: 'byte' was not declared in this scope
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:15: error: 'p' was not declared in this scope
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:15: error: expected primary-expression before ')' token
C:\arduino-0023\libraries\EEPROM/EEPROMAnything.h:15: error: expected primary-expression before 'void'
Thanks for the explanation. Knowing that's an option may help me later.Some names in quotes and some in brackets make sense. One is a local dir and the other is the public dir.