E2prom

How do I save the internal EEPROM of the char type data I received via HC-05? I will print p10 panels after I receive the data.

It is in the examples (EEPROM library). https://www.arduino.cc/en/Tutorial/EEPROMWrite

I have studied examples. I probably can not do this with the Write command. I have to use Put or Get. But I am getting the data in the loop. I'm probably making an error in the algorithm.

I’m probably making an error in the algorithm.

Why not post the code here so that we can see what you are doing.

#include <SPI.h> 
#include <EEPROM.h>
#include <DMD.h> 
#include <TimerOne.h> 
#include "SystemFont5x7.h" 
#include "Arial_black_16.h" 
#define DISPLAYS_ACROSS 1 /
#define DISPLAYS_DOWN 1   
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);
#define max_char 100       
char message[max_char];    
char r_char;                
byte index = 0;             
int i;                     
float f = 123.456f;  
int eeAddress = 0;






void ScanDMD()

{
  dmd.scanDisplayBySPI();        
}

void setup(void)
{




  Timer1.initialize( 5000 );
  Timer1.attachInterrupt( ScanDMD ); 
  dmd.clearScreen( true );
  Serial.begin(9600);                 


    }


  




void loop(void)
{

  if (Serial.available()) {          
    for (i = 0; i < 99  ; i++) {
      message[i] = '\0';
    }
    index = 0;
  }
  while (Serial.available() > 0) {      
    if (index < (max_char - 1))
    {
      r_char = Serial.read();
      message[index] = r_char;
      index++;
      message[index] = '\0';
    }
  }
  dmd.selectFont(Arial_Black_16);
  dmd.drawMarquee(message, max_char, (32 * DISPLAYS_ACROSS) - 1 , 0);     t
  long start = millis();                                           
  long timer = start;
  boolean ret = false;
  while (!ret) {
    if ((timer + 30) < millis()) {
      ret = dmd.stepMarquee(-1, 0);
      timer = millis();






}
  }
}

I deleted the commands I used for EEPROM here. The chan only receives the Hc-50 and gives the p10a as the messega variant.

I deleted the commands I used for EEPROM here

Why ? I thought that your problem was in writing to the EEPROM

Yes I can not write eeprom problem but I am doing experiments. :confused:

Show what you got so far. Having problem with writing to EEPROM and removing parts of code responsible for it wont solve the problem.

I did not remove the codes. Since I'm doing different experiments, I always try different methods.

#include <SPI.h>
#include <EEPROM.h>
#include <DMD.h>
#include <TimerOne.h>
#include "SystemFont5x7.h" 
#include "Arial_black_16.h" 
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1  
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN); 
#define max_char 100       
char message[max_char];    
char r_char;                
byte index = 0;             
int i;                      
float f = 123.456f;   
int eeAddress = 0; 
struct MyObject {
message[max_char] ;
} ;





void ScanDMD()

{
  dmd.scanDisplayBySPI();       
}

void setup(void)
{




  Timer1.initialize( 5000 );
  Timer1.attachInterrupt( ScanDMD );
  dmd.clearScreen( true );
  Serial.begin(9600);                
  EEPROM.put(eeAddress, f);
   MyObject customVar = {
 
   message[max_char]
  };
  eeAddress += sizeof(float);
}







void loop(void)
{

  if (Serial.available()) {          //*Yeni mesajı almadan önce seri haberleşmeyi kontrol ettip,eski mesajı sildim.
    for (i = 0; i < 99  ; i++) {
      message[i] = '\0';
    }
    index = 0;  //Dizini
  }
  while (Serial.available() > 0) {       
    if (index < (max_char - 1))
    {
      r_char = Serial.read();
      message[index] = r_char;
      index++;
      message[index] = '\0';
    }
  }
   EEPROM.put(eeAddress, customVar);

  dmd.selectFont(Arial_Black_16);
  dmd.drawMarquee(message, max_char, (32 * DISPLAYS_ACROSS) - 1 , 0);      
  long start = millis();                                          
  long timer = start;
  boolean ret = false;
  while (!ret) {
    if ((timer + 30) < millis()) {
      ret = dmd.stepMarquee(-1, 0);
      timer = millis();






    }
  }
}

Forget what you really want to do for now and write a small program that writes to the EEPROM then reads it back and displays it in the Serial monitor. If you create functions for the writing and reading portions of the test program then when you know that they work you can copy them into your main program and call then when needed, much as you do for the built in Arduino functions.

Why have you used a struct with only one data element ?

I doubt you have a problem with the eeprom at this moment; you more have a problem with the basics of C/C++.

Your code does not compile due to

struct MyObject {
  message[max_char] ;
} ;

After fixing that to e.g.

struct MyObject {
  char message[max_char] ;
};

the compiler will tell you to do it yourself because of

  EEPROM.put(eeAddress, customVar);

customVar is declared in setup() and hence not known in loop().