Skip to content

Instantly share code, notes, and snippets.

@avr-programmierung
Created May 14, 2019 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avr-programmierung/48bd3073f367ff58472a5db3f66bf6f2 to your computer and use it in GitHub Desktop.
Save avr-programmierung/48bd3073f367ff58472a5db3f66bf6f2 to your computer and use it in GitHub Desktop.
ATmega88 @ 1MHz EEPROM 04-02
/* eeprom_04.c ATmega88 @ 1MHz */
#include <avr/io.h>
#include <avr/eeprom.h>
float x,y;
int main(void)
{
eeprom_update_float((float*) 0, (float) 3.14); //update von 3.14 beginnend ab Speicherzelle 0
eeprom_update_float((float*) 4, (float) 5.233); //update von 5.233 beginnend ab Speicherzelle 4
x = eeprom_read_float((const float*) 0); //read float ab Speicherzelle 0
y = eeprom_read_float((const float*) 4); //read float ab Speicherzelle 4
while(1)
{
asm ("NOP");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment