Mic2015 / arduino-tiny

Automatically exported from code.google.com/p/arduino-tiny
Other
0 stars 0 forks source link

EEPROM support? #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I Use Attiny85. like this
http://hlt.media.mit.edu/?p=1695

#include <EEPROM.h>-- Compile is Passed.
But <EEPROM.h>  does NOT Work.

How to use EEPROM with ATtiny?
or Will be Support?

Original issue reported on code.google.com by shooting...@gmail.com on 21 Feb 2012 at 6:19

GoogleCodeExporter commented 9 years ago
If you want to have an effect you will have to provide a better description of 
the symptom than "does not work".

Original comment by arduino....@gmail.com on 21 Feb 2012 at 9:45

GoogleCodeExporter commented 9 years ago
Code is this.

Power on count up,
if shutdown ,after reboot still continue count up.

----------------------------------------------------
//memory count up and SEND

#include <SoftwareSerial.h>
#include <EEPROM.h>
SoftwareSerial mySerial(0,1); 
int i=0;          
int val;

void setup() {
  mySerial.begin(9600);  // RX:0 TX:1
  val = EEPROM.read(i);  //EEPROM read
 }

void loop() {
  val=val+1;
  EEPROM.write(i, val);
  mySerial.println(val) ;  //send
  delay(500);             
 }

Original comment by shooting...@gmail.com on 21 Feb 2012 at 10:17

GoogleCodeExporter commented 9 years ago
Looking around for a an exmaple how to use the EEPROM of my attiny85 I came 
across this issue. The code in comment #2 works fine with the current version 
of arduino-tiny on an attiny85.

Original comment by qistoph on 20 Sep 2012 at 8:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
You need to read back eeprom after writing it. I would also put a delay(5) 
after writing to give the eeprom circuits time to complete the write command. 

void loop() {
  val=val+1;
  EEPROM.write(i, val);

  delay(5);
  val = EEPROM.read(i);  //EEPROM read

  mySerial.println(val) ;  //send
  delay(500);             
 }

Original comment by Finchron...@gmail.com on 16 Jul 2015 at 12:08