![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Víc očí víc vidí, tak budu moc rád za jakoukoliv připomínku
![Smile :)](./images/smilies/icon_e_smile.gif)
Z mého pohledu to vypadá, že to vynechá jedno místo na začátku a zapíše to až do druhého a na to poslední pak nezůstane
![Smile :)](./images/smilies/icon_e_smile.gif)
Toto ukládám -> prosím o povšimnutí, že začíná 20 a končí FD
Kód: Vybrat vše
20202020205AFF00103037303730375A0501010059380000000069C100A598FD0501010059380000000069C100A597FD0401ED04FD3D14F628A7B80001003BFB0401ED04FD3D14F628A7B80001003AFB07026C02D901FDFF3004430C070024FC00008B0D1E0E0000470300000000ECFE05040081FE0000040000EC2C000055FD05040081FE0000040000EC2C000055FD0080808080000080008080FF000078FB0080808080000080008080FF000078FB0507000010544D42444C0100000065FE0507000010544D42444C0100000065FE323155333838383433353437530105FD323155333838383433353437530105FD4B5A375A30473433373037323001DCFC4B5A375A30473433373037323001DCFC000011136E0700000000000000001111FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0101000000000000000000000000EAFF0107000000000000000000000000E3FF0000000000000000000000000000EAFF000002226C001C000311D1023C0416FE4445028897018700000000000000B6FD0000000000000000000000000000E7FF0000000000000000000000000000E6FF0000000000000000000000000000E5FF0000303641393036303332484A2057FD303030310000000000000000000022FF01020001010A81FE007AB300000027FD01020001010A81FE007AB300000027FD
Kód: Vybrat vše
F20202020205AFF00103037303730375A0501010059380000000069C100A598FD0501010059380000000069C100A597FD0401ED04FD3D14F628A7B80001003BFB0401ED04FD3D14F628A7B80001003AFB07026C02D901FDFF3004430C070024FC00008B0D1E0E0000470300000000ECFE05040081FE0000040000EC2C000055FD05040081FE0000040000EC2C000055FD0080808080000080008080FF000078FB0080808080000080008080FF000078FB0507000010544D42444C0100000065FE0507000010544D42444C0100000065FE323155333838383433353437530105FD323155333838383433353437530105FD4B5A375A30473433373037323001DCFC4B5A375A30473433373037323001DCFC000011136E0700000000000000001111FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0101000000000000000000000000EAFF0107000000000000000000000000E3FF0000000000000000000000000000EAFF000002226C001C000311D1023C0416FE4445028897018700000000000000B6FD0000000000000000000000000000E7FF0000000000000000000000000000E6FF0000000000000000000000000000E5FF0000303641393036303332484A2057FD303030310000000000000000000022FF01020001010A81FE007AB300000027FD01020001010A81FE007AB300000027F
Kód: Vybrat vše
digitalWrite(posPIN, LOW);
digitalWrite(negPIN, HIGH);
delay(20);
char dump[EEPROMSIZE] = "0";
char readData[EEPROMSIZE * 2] = "0";
Serial.readBytes(readData, EEPROMSIZE * 2);
for (int i = 0; i < EEPROMSIZE; i++)
{
dump[i] = intValueOfHexaKey(readData[i * 2 +1]) + 16 * intValueOfHexaKey(readData[i * 2]);
Serial.print(dump[i]);
}
char ch[30];
for (uint16_t i = 0; i < EEPROMSIZE; i++)
{//how deep to write
sprintf(ch,"%02X",writeByteAt(csPIN,i,dump[i]));
}
delay(500);
digitalWrite(negPIN, LOW);
digitalWrite(posPIN, HIGH);
Kód: Vybrat vše
uint8_t writeByteAt(uint8_t cs, uint16_t adr, char d)
{
SPI.beginTransaction(SPISettings(20000000, MSBFIRST, SPI_MODE0));
digitalWrite(cs, LOW);
SPI.transfer(WREN);
digitalWrite(cs, HIGH);
delay(10);
digitalWrite(cs, LOW);
uint8_t a = highByte(adr);
a = a << 3;
a = a | WRITE;
SPI.transfer(a);
SPI.transfer(lowByte(adr));
a = SPI.transfer(d);
digitalWrite(cs, HIGH);
delay(15);
SPI.endTransaction();
return a;
}
Kód: Vybrat vše
int8_t intValueOfHexaKey(char c)
{
if ((c >= '0') && (c <= '9')) return c - '0';
if ((c >= 'A') && (c <= 'F')) return c - 'A' + 10;
return -1;
}
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)