title: ATtiny85 eeprom write in the arduino IDE
body: <p>I have a problem: I can read the EEPROM from my ATtiny, but I can't write something in it.</p>
  <p>Here is my code:</p>
  <pre><code>#include &lt;EEPROM.h&gt;
  
  int addr = 0;
  int val = 2;
      
  void setup()
  {
  }
      
  void loop()
  {
    EEPROM.write(addr, val);
        
    addr = addr + 1;
    if (addr == 512)
      addr = 0;
  }
  </code></pre>
  <p><strong>EDIT</strong></p>
  <p>Now my write code is:</p>
  <pre><code>#include &lt;EEPROM.h&gt;
  
  int addr = 0;
  int val = 2;
  
  void setup()
  {
  }
  
  void loop()
  {
    EEPROM.write(addr, byte(val));
    
    addr = addr + 1;
    if (addr == 512)
      while(1);
  }
  </code></pre>
  <p>And my read code:</p>
  <pre><code>int address = 0;
  byte value;
  
  #include &lt;SoftwareSerial.h&gt;
  
  void setup()
  {
    SSerial.begin(9600);
  }
  
  void loop()
  {
    value = EEPROM.read(address);
    
    SSerial.print(address);
    SSerial.print(&quot;\t&quot;);
    SSerial.print(value, DEC);
    SSerial.println();
    
    address = address + 1;
    
    if (address == 512){
      address = 0;
      delay(100000000);
    }
  }
  </code></pre>
  <p>I always get only teh value 255. On every adress.
  Now I convert my int to byte. My int won't get over 255 in my case.</p>
  <p>And by the way: can I create an int as byte? So I can use it like a normal int, but can write it directly?</p>