Go Down

Topic: Getting byte (in character/alphabet) out of EEPROM (Read 691 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy