eeprom_write_block error

2 years 11 months ago - 2 years 11 months ago #3578 by fr3d
hello everybody

I'm trying to compile "esp8266easyiot_temperature_humidity"
arduino IDE version is : 1.6.8
I 'm using a nodemcu 0.9 board.

I get an issue when i 've compiled esp8266easyiot_temperature_humidity.

"eeprom.h not found" from "Esp8266EasyIoT.h" as I remember.

I changed it to EEPROM.h (found in C:\Program Files (x86)\Arduino168\hardware\arduino\avr\libraries\EEPROM\src\EEPROM.h)

now I got this error

C:\Users\severine\Documents\Arduino\libraries\Esp8266EasyIoT\Esp8266EasyIoT.cpp:234:95: error: 'eeprom_write_block' was not declared in this scope

eeprom_write_block((void*)&_nodeId, (void*)EEPROM_NODE_ID_ADDRESS, sizeof(uint16_t));

.

when i look into Esp8266EasyIoT.cpp or EEPROM.h I can't find
eeprom_write_block function.

As ggolgle is my friend I found this at github.com/esp8266/Arduino/issues/414
#include "EEPROM.h"
//Call EEPROM.begin(4096); in setup()

void eeprom_read_block(uint8_t * data, uint32_t address, size_t len){
  int i;
  for(i=0; i<len; i++){
    data[i] = EEPROM.read(address+i);
  }
}

void eeprom_write_block(uint8_t * data, uint32_t address, size_t len){
  int i;
  for(i=0; i<len; i++){
    EEPROM.write(address+i, data[i]);
  }
  EEPROM.commit();
}

ok but where must I put those lines ?

regards.

Please Log in or Create an account to join the conversation.

2 years 11 months ago #3580 by fr3d
tryed with arduino 1.6.5 same result :(

Please Log in or Create an account to join the conversation.

Time to create page: 0.257 seconds

Forum latest

  • No posts to display.