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 11/*
22 ECCX08 Counter
33
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.
66
77 Circuit:
88 - Any board with ECC508 or ECC608 on board
1111
1212#include < ArduinoECCX08.h>
1313
14- const int keyId = 5 ;
14+ // The counter to be incremented. Only zero and one are legal values.
15+ const int counterId = 0 ;
1516long counter = -1 ;
1617
1718void setup () {
@@ -22,15 +23,15 @@ void setup() {
2223 Serial.println (" Failed to communicate with ECC508/ECC608!" );
2324 while (1 );
2425 }
25-
26- if (!ECCX08.incrementCounter (keyId , counter)) {
26+
27+ if (!ECCX08.incrementCounter (counterId , counter)) {
2728 Serial.println (" Failed to increment counter" );
2829 while (1 );
2930 }
3031}
3132
3233void loop () {
33- if (!ECCX08.readCounter (keyId , counter)) {
34+ if (!ECCX08.readCounter (counterId , counter)) {
3435 Serial.println (" Failed to read counter" );
3536 while (1 );
3637 }
You can’t perform that action at this time.
0 commit comments