File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
2
ECCX08 Counter
3
3
4
- This sketch uses the ECC508 or ECC608 to increment a monotonic
5
- counter at each startup
4
+ This sketch uses the ECC508 or ECC608 to increment a monotonic
5
+ counter at each startup.
6
6
7
7
Circuit:
8
8
- Any board with ECC508 or ECC608 on board
11
11
12
12
#include < ArduinoECCX08.h>
13
13
14
- const int keyId = 5 ;
14
+ // The counter to be incremented. Only zero and one are legal values.
15
+ const int counterId = 0 ;
15
16
long counter = -1 ;
16
17
17
18
void setup () {
@@ -22,15 +23,15 @@ void setup() {
22
23
Serial.println (" Failed to communicate with ECC508/ECC608!" );
23
24
while (1 );
24
25
}
25
-
26
- if (!ECCX08.incrementCounter (keyId , counter)) {
26
+
27
+ if (!ECCX08.incrementCounter (counterId , counter)) {
27
28
Serial.println (" Failed to increment counter" );
28
29
while (1 );
29
30
}
30
31
}
31
32
32
33
void loop () {
33
- if (!ECCX08.readCounter (keyId , counter)) {
34
+ if (!ECCX08.readCounter (counterId , counter)) {
34
35
Serial.println (" Failed to read counter" );
35
36
while (1 );
36
37
}
You can’t perform that action at this time.
0 commit comments