ich hab ein Array das ich ins EEprom speichern möchte jedoch steht im EEprom nur mist drin. Viellecht kann von euch jemand mir nen Tip geben was ich da Falsch mach mfg
1 | volatile uint8_t device_Adr = 0x20; |
2 | int array[30]; |
3 | |
4 | |
5 | // Byte aus dem EEPROM lesen
|
6 | uint8_t EEPReadByte(uint16_t addr) |
7 | {
|
8 | return eeprom_read_byte((uint8_t *)addr); |
9 | }
|
10 | |
11 | // Byte in das EEPROM schreiben
|
12 | void EEPWriteByte(uint16_t addr, uint8_t val) |
13 | {
|
14 | eeprom_write_byte((uint8_t *)addr, val); |
15 | }
|
16 | |
17 | void write(void ) |
18 | {
|
19 | for(i=0; i<30; i++) |
20 | {
|
21 | EEPWriteByte(array[i], device_Adr+i); |
22 | }
|
23 | }
|