forked from AlexMalov/EasyKeyDublicatorRFID_OLED
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodewrite.ino.ino
More file actions
57 lines (38 loc) · 1.05 KB
/
Copy pathcodewrite.ino.ino
File metadata and controls
57 lines (38 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* EEPROM Write
*
* Stores values read from analog input 0 into the EEPROM.
* These values will stay in the EEPROM when the board is
* turned off and may be retrieved later by another sketch.
*/
#include <EEPROM.h>
/** the current address in the EEPROM (i.e. which byte we're going to write to next) **/
int order=1; //Keep this within 1-20. Don't go beyond!
int addr = order*8;
void setup() {
/** Empty setup. **/
}
void loop() {
int hdr = 1; //0x01 = DS1990 (TM with sn), 0x0C=DS1996 (tm with SN and 64k eeprom)
int b1 = 1;
int b2 = 255;
int b3 = 255;
int b4 = 255;
int b5 = 255;
int b6 = 255;
int crc = 47; //calculate this with OWCRC.exe
/***
Write the value to the appropriate byte of the EEPROM.
these values will remain there when the board is
turned off.
***/
EEPROM.write(addr, hdr);
EEPROM.write(addr+1, b1);
EEPROM.write(addr+2, b2);
EEPROM.write(addr+3, b3);
EEPROM.write(addr+4, b4);
EEPROM.write(addr+5, b5);
EEPROM.write(addr+6, b6);
EEPROM.write(addr+7, crc);
delay(10000);
}