Go Down

Topic: Getting byte (in character/alphabet) out of EEPROM (Read 670 times) previous topic - next topic

Khalid

I am playing with EEPROM.. Have just wrote down a

Code: [Select]
#include <EEPROM.h>
int addr = 0;
void setup()
{
}

void loop()
{
  byte val = 'K';
  EEPROM.write(addr, val);
}


Now i want the EEPROM value back in character i.e. K, i am not succeeded so far:

Code: [Select]
#include <EEPROM.h>
int address = 0;
byte value;
void setup()
{
  Serial.begin(9600);
}
void loop()
{
  value = EEPROM.read(address);
  Serial.print(address);
  Serial.print("\t");
  Serial.print(value, DEC);
  Serial.println();
}


I don't know how to convert the EEPROM return value into character?
Simply...You can't afford me..

Author Of:
http://my-woodcarving.blogspot.com/
http://www.free3dscans.blogspot.com/
http://my-diysolarwind.blogspot.com/

Oops..some one gave me Karma...:)

Khalid

Got it working:)
Code: [Select]
#include <EEPROM.h>
int address = 0;
byte value;
void setup()
{
  Serial.begin(9600);
}
void loop()
{
  value = EEPROM.read(address);
  char c=char(value);
  Serial.print(address);
  Serial.print("\t");
  Serial.print(c);
  Serial.println();
}
Simply...You can't afford me..

Author Of:
http://my-woodcarving.blogspot.com/
http://www.free3dscans.blogspot.com/
http://my-diysolarwind.blogspot.com/

Oops..some one gave me Karma...:)

Go Up