![Embarrassed :oops:](./images/smilies/icon_redface.gif)
úprava před uložením/ po čtení
Kód: Vybrat vše
float FRamReadBank(unsigned int Address)
{
float EEPROMReadBankResult = ReadFromFRam(Address);
EEPROMReadBankResult = EEPROMReadBankResult / 10;
return EEPROMReadBankResult;
}
float FRamWriteBank(unsigned int Address, float Number)
{
// Serial.print("float number ");
//Serial.println(Number, 5);
unsigned int EEPROMBuffer = Number * 10;
//Serial.println(EEPROMBuffer, DEC);
WriteToFRam(Address, EEPROMBuffer);
}
Kód: Vybrat vše
int ReadFromFRam(int Address)
{
byte byte1 = fram.read8(Address);
byte byte2 = fram.read8(Address + 1);
return (byte1 << 8) + byte2;
}
int WriteToFRam(int Address, int Number)
{
fram.write8(Address, (Number >> 8) );
fram.write8(Address + 1, (Number & 0xFF));
}