Hi guys, I've been searching a lot and can't seem to get a solid answer on this. I'm trying to use EEPROM.read() and write() in a class. Can someone tell me where I'm going so terribly wrong? Thanks.
#ifndef _PHONEMEMORY_H_
#define _PHONEMEMORY_H_
#include <Arduino.h>
#include <string.h>
#include <EEPROM.h>
class PhoneMemory
{
public:
PhoneMemory();
int addPhone(char *number);
};
#endif
#include "PhoneMemory.h"
int PhoneMemory::addPhone(char *number)
{
EEPROM.read(1);
}
Error:
PhoneMemory.cpp: In member function 'int PhoneMemory::addPhone(char*)':
PhoneMemory.cpp:12: error: 'EEPROM' was not declared in this scope
#include <SoftwareSerial.h> //Include the NewSoftSerial library to send serial commands to the cellular module.
#include <string.h> //Used for string manipulations
#include "CircularBuffer.h"
#include "PhoneMemory.h"
#include <EEPROM.h>
I've tried it with both EEPROM.h being included and not included in the .ino. I find it weird that Serial will work just fine in the class but EEPROM won't.