dmd count varible save eeprom problem

hello I don’t know the English translation is I am writing with the help of the Dmd (Dot Matrix Display ) project ekranna the latest data printed in the eeprom memory not solve the problem, I want to register, I waiting for your help

I could not have researched EEPROM sample code :frowning:
code:

// DMDcountup.ino 18/04/2013 John Boxall. 
// HIGH on digital 2 increments number, 3 resets. 

#include <DMD.h> // for DMD
#include <SPI.h> // SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include <TimerOne.h> 
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
DMD dmd(1, 1); // creates instance of DMD to refer to in sketch


void ScanDMD() // necessary interrupt handler for refresh scanning of DMD
{ 
  dmd.scanDisplayBySPI();
}

void setup()
{
  //initialize TimerOne's interrupt/CPU usage used to scan and refresh the display
  Timer1.initialize( 5000 );           //period in microseconds to call ScanDMD. Anything longer than 5000 (5ms) and you can see flicker.
  Timer1.attachInterrupt( ScanDMD );   //attach the Timer1 interrupt to ScanDMD which goes to dmd.scanDisplayBySPI()  
  dmd.clearScreen( true );   //true is normal (all pixels off), false is negative (all pixels on)
  dmd.selectFont(Arial_Black_16);    
  drawNumber(0);
}

void drawNumber(int value)
{
  switch(value)
  {
  case 0:
    dmd.clearScreen( true );   //true is normal (all pixels off), false is negative (all pixels on)
    dmd.selectFont(System5x7);
    dmd.drawString( 4,4, "test1", 4, GRAPHICS_NORMAL );
    
    break;
  case 1:
    dmd.clearScreen( true );   //true is normal (all pixels off), false is negative (all pixels on)
    dmd.selectFont(System5x7);
    dmd.drawString( 2,3, "test2", 6, GRAPHICS_NORMAL );
    break;
  case 2:
    dmd.clearScreen( true );   //true is normal (all pixels off), false is negative (all pixels on)
    dmd.selectFont(System5x7);
    dmd.drawString( 2,3, "test3", 4, GRAPHICS_NORMAL );
    break;


  }
}

int count=0;

void loop()
{

  if (digitalRead(2)==HIGH)
  {
    count++;
    delay(250);
    if (count>3) 
    {
      count=0;
      dmd.clearScreen(true);
    }
    drawNumber(count);
  }
  if (digitalRead(3)==HIGH)
  {
    count=0;
    delay(250);    
    dmd.clearScreen(true);    
    drawNumber(count);
  }
}

I don't understand the question, if there is one.

I want to save the last operation

varible count= save eeprom

count write eeprom

count read eeprom

I'm still unclear what it is you're trying to do, but this may be a good starting point.
Be very careful with your testing; you can wear EEPROM out very quickly.

I want to do coding without plug-ins

OK

Is it possible to make a simple way to record

// 

#include <DMD.h> // for DMD
#include <SPI.h> // SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include <TimerOne.h> 
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
#include <EEPROM.h
DMD dmd(1, 1); // creates instance of DMD to refer to in sketch

int count;
int addr;
void ScanDMD() // necessary interrupt handler for refresh scanning of DMD
{ 
  dmd.scanDisplayBySPI();
}

void setup()
{
  //initialize TimerOne's interrupt/CPU usage used to scan and refresh the display
  Timer1.initialize( 5000 );           //period in microseconds to call ScanDMD. Anything longer than 5000 (5ms) and you can see flicker.
  Timer1.attachInterrupt( ScanDMD );   //attach the Timer1 interrupt to ScanDMD which goes to dmd.scanDisplayBySPI()  
  dmd.clearScreen( true );   //true is normal (all pixels off), false is negative (all pixels on)
  dmd.selectFont(Arial_Black_16);    
  drawNumber(0);
 EEPROM.read(count);
  delay(10); 
}

void drawNumber(int value)
{
  switch(value)
  {
  case 0:
    dmd.clearScreen( true );   //true is normal (all pixels off), false is negative (all pixels on)
    dmd.selectFont(System5x7);
    dmd.drawString( 4,4, "test1", 4, GRAPHICS_NORMAL );
    
    break;
  case 1:
    dmd.clearScreen( true );   //true is normal (all pixels off), false is negative (all pixels on)
    dmd.selectFont(System5x7);
    dmd.drawString( 2,3, "test2", 6, GRAPHICS_NORMAL );
    break;
  case 2:
    dmd.clearScreen( true );   //true is normal (all pixels off), false is negative (all pixels on)
    dmd.selectFont(System5x7);
    dmd.drawString( 2,3, "test3", 4, GRAPHICS_NORMAL );
    break;


  }
}

int count=0;

void loop()
{
 
  if (digitalRead(2)==HIGH)
  {
    count++;
    delay(250);
    if (count>3) 
EEPROM.write(addr, count);
       delay(10);
    {
      count=0;
      dmd.clearScreen(true);
    }
    drawNumber(count);
  }
  if (digitalRead(3)==HIGH)
  {
    count=0;
    delay(250);    
    dmd.clearScreen(true);    
    drawNumber(count);
  }
}

The basic EEPROM interface enables you to read and write to a byte at a time. If you're reading and writing values that occupy more than a byte then you need to read and write each byte separately. There are 'some 'EEPROM write anything' helper functions in the playground which take care of that for you so that you can write a piece of data to the EEPROM by a single fuinction call, and read it back by another single function call. It's not obvious that saving your value in EEPROM is a sensible thing to do, or that you're managing the frequency of EEPROM writes to avoid wearing the EEPROM out, but the mechanism of writing to and reading from EEPROM is very simple. In order to grasp it, I recommend that you write a test sketch that does nothing but that. Make sure your test sketch only updates the EEPROM at a low frequency or you are liable to wear it out - the Arduino can access the EEPROM fast enough to use its entire life up within a few seconds if you code it wrongly.