Home › Forums › Mayfly Data Logger › Reading from EEPROM error in code
- This topic has 6 replies, 3 voices, and was last updated 2021-03-03 at 1:11 PM by Sara Damiano.
-
AuthorPosts
-
-
2021-03-02 at 2:51 AM #15184Hi,
I am trying to write some code to test some new low-cost sensors, including a DFRobot gravity conductivity sensor (https://www.dfrobot.com/product-1123.html). I have used snippets of DFRobot
Hi,I am trying to write some code to test some new low-cost sensors, including a DFRobot gravity conductivity sensor (https://www.dfrobot.com/product-1123.html). I have used snippets of DFRobot’s code, and built calculated variable functions in modular sensors to read data. In this case the DFRobor code uses a ‘k’ value as a crude calibration method, i.e. essentially a scaling factor. I use a separate calibration script to calculate the k value and store it in the EEPROM, which is retrieved upon initiation of the modular sensors program.
This method works if I build a script that only reads and returns the SpC value from the condy sensor. However, the same line of code returns an error when I combine it with the modular sensor code.
123error: expected unqualified-id before '{' token#define EEPROM_read(address, p) {int i = 0; byte *pp = (byte*)&(p);for(; i < sizeof(p); i++) pp[i]=EEPROM.read(address+i);}^If I comment out all the references to the EEPROM and use a defined k value instead (e.g. kvalue = 1), the modular sensors code compiles with no problems.
I usually like to work through coding issues myself but in this case I seem to be overlooking something seemingly simple. Can anyone see anything obvious that I am missing?
Thanks in advance for your help.
Regards,
James
My full modular sensor code (please forgive my inefficiencies, I am just learning c++) :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522/*****************************************************************************simple_logging.inoWritten By: Sara Damiano (sdamiano@stroudcenter.org)Development Environment: PlatformIOHardware Platform: EnviroDIY Mayfly Arduino DataloggerSoftware License: BSD-3.Copyright (c) 2017, Stroud Water Research Center (SWRC)and the EnviroDIY Development TeamThis sketch is an example of logging data to an SD cardDISCLAIMER:THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.*****************************************************************************/// ==========================================================================// Defines for the Arduino IDE// In PlatformIO, set these build flags in your platformio.ini// ==========================================================================#ifndef TINY_GSM_RX_BUFFER#define TINY_GSM_RX_BUFFER 64#endif#ifndef TINY_GSM_YIELD_MS#define TINY_GSM_YIELD_MS 2#endif#ifndef MQTT_MAX_PACKET_SIZE#define MQTT_MAX_PACKET_SIZE 240#endif// ==========================================================================// Include the base required libraries// ==========================================================================#include <Arduino.h> // The base Arduino library#include <EnableInterrupt.h> // for external and pin change interrupts#include <LoggerBase.h> // The modular sensors library#include <Adafruit_ADS1015.h>Adafruit_ADS1115 ads; /* Use this for the Mayfly because of the onboard 16-bit ADS1115 */#include <EEPROM.h> // use this to get the K value from the EEPROM//EEPROM READ KVALUE#define EEPROM_read(address, p) {int i = 0; byte *pp = (byte*)&(p);for(; i < sizeof(p); i++) pp[i]=EEPROM.read(address+i);}#define KVALUEADDR 0x0F#include <OneWire.h>#include <DallasTemperature.h>/********************************************************************/// Data wire is plugged into pin 7 on the Arduino#define ONE_WIRE_BUS 5 // For EnviroDIY Mayfly, I am using digital pin 7./********************************************************************/// Setup a oneWire instance to communicate with any OneWire devices// (not just Maxim/Dallas temperature ICs)OneWire oneWire(ONE_WIRE_BUS);/********************************************************************/// Pass our oneWire reference to Dallas Temperature.DallasTemperature sensors(&oneWire);// ==========================================================================// Data Logger Settings// ==========================================================================// The name of this fileconst char *sketchName = "Kopurererua_Taumata.ino";// Logger ID, also becomes the prefix for the name of the data file on SD cardconst char *LoggerID = "Kopurererua at Taumata Bridge";// How frequently (in minutes) to log dataconst uint8_t loggingInterval = 15;// Your logger's timezone.const int8_t timeZone = 12; // Eastern Standard Time// NOTE: Daylight savings time will not be applied! Please use standard time!// ==========================================================================// Primary Arduino-Based Board and Processor// ==========================================================================#include <sensors/ProcessorStats.h>const long serialBaud = 115200; // Baud rate for the primary serial port for debuggingconst int8_t greenLED = 8; // MCU pin for the green LED (-1 if not applicable)const int8_t redLED = 9; // MCU pin for the red LED (-1 if not applicable)const int8_t buttonPin = 21; // MCU pin for a button to use to enter debugging mode (-1 if not applicable)const int8_t wakePin = A7; // MCU interrupt/alarm pin to wake from sleep// Set the wake pin to -1 if you do not want the main processor to sleep.// In a SAMD system where you are using the built-in rtc, set wakePin to 1const int8_t sdCardPwrPin = -1; // MCU SD card power pin (-1 if not applicable)const int8_t sdCardSSPin = 12; // MCU SD card chip select/slave select pin (must be given!)const int8_t sensorPowerPin = 22; // MCU pin controlling main sensor power (-1 if not applicable)// Create the main processor chip "sensor" - for general metadataconst char *mcuBoardVersion = "v0.5b";ProcessorStats mcuBoard(mcuBoardVersion);// ==========================================================================// Wifi/Cellular Modem Settings// ==========================================================================// Create a reference to the serial port for the modemHardwareSerial &modemSerial = Serial1; // Use hardware serial if possible// Modem Pins - Describe the physical pin connection of your modem to your boardconst int8_t modemVccPin = -1; // MCU pin controlling modem power (-1 if not applicable)//const bool useCTSforStatus = false; // Flag to use the XBee CTS pin for statusconst int8_t modemStatusPin = 19; // MCU pin used to read modem status (-1 if not applicable)const int8_t modemResetPin = 20; // MCU pin connected to modem reset pin (-1 if unconnected)const int8_t modemSleepRqPin = 23; // MCU pin used for modem sleep/wake request (-1 if not applicable)const int8_t modemLEDPin = redLED; // MCU pin connected an LED to show modem status (-1 if unconnected)// // Network connection information// Network connection informationconst char *apn = "m2m"; // The APN for the gprs connection// const char *wifiId = "Dare_Family"; // The WiFi access point, unnecessary for gprs// const char *wifiPwd = "119HarveyStreet"; // The password for connecting to WiFi, unnecessary for gprs// ==========================================================================// The modem object// Note: Don't use more than one!// ==========================================================================//#elif defined MS_BUILD_TESTING && defined MS_BUILD_TEST_XBEE_LTE_B// For the u-blox SARA R410M based Digi LTE-M XBee3// NOTE: According to the manual, this should be less stable than transparent// mode, but my experience is the complete reverse.#include <modems/DigiXBeeLTEBypass.h>//#include <modems/SodaqDigiXBeeLTEBypass.h>const long modemBaud = 9600; // All XBee's use 9600 by defaultconst bool useCTSforStatus = false; // Flag to use the XBee CTS pin for status// NOTE: If possible, use the STATUS/SLEEP_not (XBee pin 13) for status, but// the CTS pin can also be used if necessaryDigiXBeeLTEBypass modemXBLTEB(&modemSerial,modemVccPin, modemStatusPin, useCTSforStatus,modemResetPin, modemSleepRqPin,apn);// Create an extra reference to the modem by a generic name (not necessary)DigiXBeeLTEBypass modem = modemXBLTEB;// ==========================================================================// ==========================================================================// Conductvity sensor settings// ==========================================================================// //Cond sensor pinsconst int SpCSensorPin = 3;//const float Kvalue = -9999;//updated 05/11/2020const float Kvalue = 1;EEPROM_read(KVALUEADDR, Kvalue); //1.0 means no change to raw readings// ==========================================================================// eTape sensor settings// ==========================================================================//const int eTapeSensorPin = 1;// ==========================================================================// Maxim DS3231 RTC (Real Time Clock)// ==========================================================================#include <sensors/MaximDS3231.h> // Includes wrapper functions for Maxim DS3231 RTC// Create a DS3231 sensor object, using this constructor function:MaximDS3231 ds3231(1);// ==========================================================================// pH sensor settings// ==========================================================================const int pHSensorPin = 3; //check pH sensor pin.// ==========================================================================// Maxim DS18 One Wire Temperature Sensor// ==========================================================================#include <sensors/MaximDS18.h>// OneWire Address [array of 8 hex characters]// If only using a single sensor on the OneWire bus, you may omit the address// DeviceAddress OneWireAddress1 = {0x28, 0xFF, 0xBD, 0xBA, 0x81, 0x16, 0x03, 0x0C};const int8_t OneWirePower = sensorPowerPin; // Pin to switch power on and off (-1 if unconnected)const int8_t OneWireBus = 5; // Pin attached to the OneWire Bus (-1 if unconnected) (D24 = A0)// Create a Maxim DS18 sensor objects (use this form for a known address)// MaximDS18 ds18(OneWireAddress1, OneWirePower, OneWireBus);// Create a Maxim DS18 sensor object (use this form for a single sensor on bus with an unknown address)MaximDS18 ds18(OneWirePower, OneWireBus);// Create a temperature variable pointer for the DS18//float ds18Temp = -9999;Variable* ds18Temp =new MaximDS18_Temp(&ds18, "de727a28-dcf9-4502-97e1-40811172ccbf");// ==========================================================================// eTape Water Level Sensor// ==========================================================================float getWL(int eTapePin){#define VREF 3.3 // analog reference voltage(Volt) of the ADC 3.3 or 5???#define SCOUNT 50 // number of sample points to collect for averagingfloat voltage;int analogBuffer[SCOUNT]; // store the analog value in the array, read from ADCint analogBufferTemp[SCOUNT];int analogBufferIndex = 0, copyIndex = 0;digitalWrite(22, HIGH);while (analogBufferIndex < SCOUNT) // read the sensor every 50 milliseconds, SCOUNT times and store in array{analogBuffer[analogBufferIndex] = ads.readADC_SingleEnded(eTapePin); //read the analog value and store into the bufferanalogBufferIndex++;// if(analogBufferIndex == SCOUNT)delay(50u); //delay 50 milliseconds between taking sample}analogBufferIndex = 0;for(copyIndex=0;copyIndex<SCOUNT;copyIndex++) // for coppyIndex = 0 to SCOUNT-1analogBufferTemp[copyIndex]= analogBuffer[copyIndex]; // copy analogBuffer to analogBufferTempvoltage = (getMedianNum(analogBufferTemp,SCOUNT)*VREF)/17585.0; // read the analog value,//digitalWrite(22, LOW);return voltage; //this is where you would convert voltage to stage.}//=============================================================// eTape as a calculated variable//===========================================================float calculateeTape(void){float calculatedResult = -9999; // Always safest to start with a bad value//sensors.requestTemperatures();//float temperature = sensors.getTempCByIndex(0);//float temperature = MaximDS18_Temp(&ds18);calculatedResult = getWL(eTapeSensorPin);//alculatedResult = getSpc(Kvalue, SpCSensorPin);return calculatedResult;}// Properties of the calculated variableconst uint8_t calculatedVareTapeResolution = 2; // The number of digits after the decimal placeconst char *calculatedVareTapeName = "Gage height"; // This must be a value from http://vocabulary.odm2.org/variablename/const char *calculatedVareTapeUnit = "cm"; // This must be a value from http://vocabulary.odm2.org/units/const char *calculatedVareTapeCode = "WL"; // A short code for the variableconst char *calculatedVareTapeUUID = "ea95ead2-f3ff-4737-a145-cc844d2a5537"; // The (optional) universallly unique identifier// Finally, Create a calculated variable pointer and return a variable pointer to itVariable *eTapeVariable = new Variable(calculateeTape, calculatedVareTapeResolution,calculatedVareTapeName, calculatedVareTapeUnit,calculatedVareTapeCode, calculatedVareTapeUUID);// ==========================================================================// Function for Specific Conductivity using the DFROBOT TDS sensor// ==========================================================================//Eventually I would like to add this to a library// get SpC value from sensorfloat getSpC(float Kvalue, int SpCSensorPin){// --------------------------------------------------------#define VREF 3.3 // analog reference voltage(Volt) of the ADC#define SCOUNT 50 // number of sample points to collect for averagingint analogBuffer[SCOUNT]; // store the analog value in the array, read from ADCint analogBufferTemp[SCOUNT];int analogBufferIndex = 0, copyIndex = 0;float averageVoltage = 0, K = Kvalue; // K is a crude calibration factor that can be used to tune the readingsfloat SpC = -1.1;float ds18TempVal = ds18Temp ->getValue();digitalWrite(22, HIGH);while (analogBufferIndex < SCOUNT) // read the sensor every 50 milliseconds, SCOUNT times and store in array{analogBuffer[analogBufferIndex] = ads.readADC_SingleEnded(SpCSensorPin); //read the analog value and store into the bufferanalogBufferIndex++;delay(50u); //delay 50 milliseconds between taking sample}analogBufferIndex = 0;for(copyIndex=0;copyIndex<SCOUNT;copyIndex++) // for coppyIndex = 0 to SCOUNT-1analogBufferTemp[copyIndex]= analogBuffer[copyIndex]; // copy analogBuffer to analogBufferTempaverageVoltage = getMedianNum(analogBufferTemp,SCOUNT) * VREF /17585.0; // read the analog value,float compensationCoefficient=1.0+0.019*(ds18TempVal-25.0); //temperature compensation formula: 0.019 used by YSISpC= ( 133.42*averageVoltage*averageVoltage*averageVoltage- 255.86*averageVoltage*averageVoltage+ 857.39*averageVoltage) /compensationCoefficient * K; //convert voltage value to SpC value, then correct for tempdigitalWrite(22, LOW);return SpC;} // end of getSpC//=============================================================// Conductivity/TDS as a calculated variable//===========================================================float calculateConductivity(void){float calculatedResult = -9999; // Always safest to start with a bad value//sensors.requestTemperatures();calculatedResult = getSpC(Kvalue, SpCSensorPin);//alculatedResult = getSpc(Kvalue, SpCSensorPin);return calculatedResult;}// Properties of the calculated variableconst uint8_t calculatedVarCondResolution = 2; // The number of digits after the decimal placeconst char *calculatedVarCondName = "Conductivity"; // This must be a value from http://vocabulary.odm2.org/variablename/const char *calculatedVarCondUnit = "uS/cm"; // This must be a value from http://vocabulary.odm2.org/units/const char *calculatedVarCondCode = "Cond"; // A short code for the variableconst char *calculatedVarCondUUID = "1c0765dd-cde9-4532-94aa-ac3596977a94"; // The (optional) universallly unique identifier// Finally, Create a calculated variable pointer and return a variable pointer to itVariable *ConductivityVariable = new Variable(calculateConductivity, calculatedVarCondResolution,calculatedVarCondName, calculatedVarCondUnit,calculatedVarCondCode, calculatedVarCondUUID);// ==========================================================================// Function for pH// ==========================================================================float getpH(int pHSensorPin){#define VREF 3.3 // analog reference voltage(Volt) of the ADC#define SCOUNT 50 // number of sample points to collect for averagingint analogBuffer[SCOUNT]; // store the analog value in the array, read from ADCint analogBufferTemp[SCOUNT];int analogBufferIndex = 0, copyIndex = 0;float averageVoltage = 0;//int SpCSensorPin = 3;float pHValue = -9999;#define Offset 0.11 //deviation compensatedigitalWrite(22, HIGH);while (analogBufferIndex < SCOUNT) // read the sensor every 50 milliseconds, SCOUNT times and store in array{analogBuffer[analogBufferIndex] = ads.readADC_SingleEnded(pHSensorPin); //read the analog value and store into the bufferanalogBufferIndex++;delay(50u); //delay 50 milliseconds between taking sample}analogBufferIndex = 0;for(copyIndex=0;copyIndex<SCOUNT;copyIndex++) // for coppyIndex = 0 to SCOUNT-1analogBufferTemp[copyIndex]= analogBuffer[copyIndex]; // copy analogBuffer to analogBufferTempaverageVoltage = getMedianNum(analogBufferTemp,SCOUNT) * VREF /17585.0; // read the analog value,pHValue = 3.5*averageVoltage+Offset;digitalWrite(22, LOW);return pHValue;}//=============================================================// pH as a calculated variable//===========================================================float calculatepH(void){float calculatedResult = -9999; // Always safest to start with a bad valuecalculatedResult = getpH(pHSensorPin);return calculatedResult;}// Properties of the calculated variableconst uint8_t calculatedVarpHResolution = 2; // The number of digits after the decimal placeconst char *calculatedVarpHName = "pH"; // This must be a value from http://vocabulary.odm2.org/variablename/const char *calculatedVarpHUnit = "pH Units"; // This must be a value from http://vocabulary.odm2.org/units/const char *calculatedVarpHCode = "pH"; // A short code for the variableconst char *calculatedVarpHUUID = "d0732a12-4201-4e7d-aa51-eef1adbc1e60"; // The (optional) universallly unique identifier// Finally, Create a calculated variable pointer and return a variable pointer to itVariable *pHVariable = new Variable(calculatepH, calculatedVarpHResolution,calculatedVarCondName, calculatedVarpHUnit,calculatedVarpHCode, calculatedVarpHUUID);// ==========================================================================// Creating the Variable Array[s] and Filling with Variable Objects// ==========================================================================Variable *variableList[] = {//new ProcessorStats_SampleNumber(&mcuBoard),//new ProcessorStats_FreeRam(&mcuBoard),new ProcessorStats_Battery(&mcuBoard,"33641a78-a462-4ca1-a62c-4ea8ad4ec672"),//new MaximDS3231_Temp(&ds3231),new MaximDS18_Temp(&ds18,"de727a28-dcf9-4502-97e1-40811172ccbf"),ConductivityVariable,eTapeVariable,pHVariable// Additional sensor variables can be added here, by copying the syntax// for creating the variable pointer (FORM1) from the <code>menu_a_la_carte.ino</code> example// The example code snippets in the wiki are primarily FORM2.};// Count up the number of pointers in the arrayint variableCount = sizeof(variableList) / sizeof(variableList[0]);// Create the VariableArray objectVariableArray varArray;// ==========================================================================// The Logger Object[s]// ==========================================================================// Create a logger instanceLogger dataLogger;// ==========================================================================// Working Functions// ==========================================================================// Flashes the LED's on the primary boardvoid greenredflash(uint8_t numFlash = 4, uint8_t rate = 75){for (uint8_t i = 0; i < numFlash; i++) {digitalWrite(greenLED, HIGH);digitalWrite(redLED, LOW);delay(rate);digitalWrite(greenLED, LOW);digitalWrite(redLED, HIGH);delay(rate);}digitalWrite(redLED, LOW);}//Median Funtion// calculate a median for set of values in bufferint getMedianNum(int bArray[], int iFilterLen){ int bTab[iFilterLen];for (byte i = 0; i<iFilterLen; i++)bTab[i] = bArray[i]; // copy input array into BTab[] arrayint i, j, bTemp;for (j = 0; j < iFilterLen - 1; j++) // put array in ascending order{ for (i = 0; i < iFilterLen - j - 1; i++){ if (bTab[i] > bTab[i + 1]){ bTemp = bTab[i];bTab[i] = bTab[i + 1];bTab[i + 1] = bTemp;}}}if ((iFilterLen & 1) > 0) // check to see if iFilterlen is odd or even using & (bitwise AND) i.e if length &AND 1 is TRUE (>0)bTemp = bTab[(iFilterLen - 1) / 2]; // then then it is odd, and should take the central valueelsebTemp = (bTab[iFilterLen / 2] + bTab[iFilterLen / 2 - 1]) / 2; // if even then take aveage of two central valuesreturn bTemp;} //end getmedianNum// ==========================================================================// Main setup function// ==========================================================================void setup(){// Start the primary serial connectionSerial.begin(serialBaud);ads.begin();//check//sensors.begin();//just checking the code for this//float kvaluecheck = -9999;//EEPROM_read(KVALUEADDR, kvaluecheck);// Serial.print("EEPROM KVALUE:");//Serial.println(kvaluecheck);// Print a start-up note to the first serial portSerial.print(F("Now running "));Serial.print(sketchName);Serial.print(F(" on Logger "));Serial.println(LoggerID);Serial.println();Serial.print(F("Using ModularSensors Library version "));Serial.println(MODULAR_SENSORS_VERSION);// Set up pins for the LED'spinMode(greenLED, OUTPUT);digitalWrite(greenLED, LOW);pinMode(redLED, OUTPUT);digitalWrite(redLED, LOW);// Blink the LEDs to show the board is on and starting upgreenredflash();// Set the timezones for the logger/data and the RTC// Logging in the given time zoneLogger::setLoggerTimeZone(timeZone);// It is STRONGLY RECOMMENDED that you set the RTC to be in UTC (UTC+0)Logger::setRTCTimeZone(0);// Set information pinsdataLogger.setLoggerPins(wakePin, sdCardSSPin, sdCardPwrPin, buttonPin, greenLED);// Begin the variable array[s], logger[s], and publisher[s]varArray.begin(variableCount, variableList);dataLogger.begin(LoggerID, loggingInterval, &varArray);// Set up the sensorsSerial.println(F("Setting up sensors..."));varArray.setupSensors();// Create the log file, adding the default header to it// Do this last so we have the best chance of getting the time correct and// all sensor names correctdataLogger.createLogFile(true); // true = write a new header// Call the processor sleepdataLogger.systemSleep();}// ==========================================================================// Main loop function// ==========================================================================void loop(){dataLogger.logData();} -
2021-03-02 at 10:17 AM #15185I think you just missed commenting out one more reference to the EEPROM in line 144:
EEPROM_read(KVALUEADDR, Kvalue); //1.0 means no change to raw readings
. Just commenting or deleting thI think you just missed commenting out one more reference to the EEPROM in line 144:EEPROM_read(KVALUEADDR, Kvalue); //1.0 means no change to raw readings
. Just commenting or deleting that line should fix the compiler error. I would also suggest you delete lines 38-43 so you’re not even trying to include the unused EEPROM library.If you wanted to, you could use the “extVoltage” sensor in ModularSensors with >1 reading to simplify all your code for reading the analog values. You would still need to create a calculated variable for the pH, conductivity, and eTape calculated from the voltage. There’s nothing wrong, though, with reading the value and doing the calculations just as you are.
-
2021-03-02 at 10:30 AM #15186If you’re still using the Arduino IDE, you might consider switching to VSCode (or Atom) with PlatformIO. I know VSCode seems very scary to start with, but if you’re writing new code or eIf you’re still using the Arduino IDE, you might consider switching to VSCode (or Atom) with PlatformIO. I know VSCode seems very scary to start with, but if you’re writing new code or even just copy-pasting chunks the linting tools it provides are invaluable. When I created a project for your code in VSCode, it immediately highlighted the errant EEPROM line. I know when I try write code of any type without the linter, I always screw up and miss semicolons or other small errors that are really hard to find with your eyes reading the code but which the linter flags right away.
-
2021-03-02 at 3:08 PM #15187Thanks @srgdamiano! I will try again when I get home from work.
I am using Atom with PlatformIO. How do I turn the linter tools on? thanks also for the tip on ‘extVoltage’. I was go
Thanks @srgdamiano! I will try again when I get home from work.I am using Atom with PlatformIO. How do I turn the linter tools on? thanks also for the tip on ‘extVoltage’. I was going to write a function that did the same thing as the unnecessary repetition was starting to bug me!
James
-
2021-03-03 at 2:47 AM #15190Hi Sara,
I worked through this and everything compiles correctly now! Thanks for your help.
I did wonder about the linter in Atom. From what I have read there seems to be an issue with linters w
Hi Sara,I worked through this and everything compiles correctly now! Thanks for your help.
I did wonder about the linter in Atom. From what I have read there seems to be an issue with linters working with .ino files in Atom. Have you guys found anything that works?
James
-
2021-03-03 at 1:01 PM #15191In case its of interest, I’m using the EEPROMClass from EEPROM.h
\.platformio\packages\framework-arduino-avr\libraries\EEPROM\src
EEPROM.put(EP_PERSISTENT_STORE_ADDR, epc.app); where epc.app
In case its of interest, I’m using the EEPROMClass from EEPROM.h\.platformio\packages\framework-arduino-avr\libraries\EEPROM\src
EEPROM.put(EP_PERSISTENT_STORE_ADDR, epc.app); where epc.app is a typedef containing all the values to be stored/read from persistent EEPROM.
and similarly
EEPROM.get(EP_PERSISTENT_STORE_ADDR, epc.app);
-
2021-03-03 at 1:11 PM #15192I’ve been using primarily VSCode for a while because it loads faster on my computer, but I believe I set Atom up to force ino’s as cpp’s: https://docs.platformio.org/en/latest/inteI’ve been using primarily VSCode for a while because it loads faster on my computer, but I believe I set Atom up to force ino’s as cpp’s: https://docs.platformio.org/en/latest/integration/ide/atom.html#force-arduino-file-as-c
-
-
AuthorPosts
- You must be logged in to reply to this topic.