File tree Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Expand file tree Collapse file tree 2 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ ECCX08 Random Number running on an M5Stack Core2 ESP32 IoT EduKit
3+
4+ This sketch uses the ECC508 or ECC608 to generate a random number
5+ every second and print it to the Serial monitor
6+
7+ Circuit:
8+ - M5Stack Core2 ESP32 IoT EduKit
9+
10+ */
11+ #include < ArduinoECCX08.h>
12+
13+ void setup () {
14+ Serial.begin (115200 ); Serial.println ();
15+
16+ // The M5STack IoT EduKit has the ATECECCX08 at I2C address 0x35 and SDA 21, SCL 22.
17+ Wire.begin (21 ,22 );
18+ if (!ECCX08.begin (0x35 )) {
19+ Serial.println (" Failed to communicate with ECC508/ECC608!" );
20+ while (1 );
21+ }
22+
23+ if (!ECCX08.locked ()) {
24+ Serial.println (" The ECC508/ECC608 is not locked!" );
25+ while (1 );
26+ }
27+ }
28+
29+ void loop () {
30+ Serial.print (" Random number = " );
31+ Serial.println (ECCX08.random (65535 ));
32+
33+ delay (1000 );
34+ }
35+
Original file line number Diff line number Diff line change 2323#include < Arduino.h>
2424#include < Wire.h>
2525
26- #ifndef CONFIG_ARDUINO_ECCX08_I2C_ADDR
27- #define CONFIG_ARDUINO_ECCX08_I2C_ADDR 0x60
28- #endif
29-
3026class ECCX08Class
3127{
3228public:
You can’t perform that action at this time.
0 commit comments