File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
content/hardware/02.hero/boards/uno-r4-wifi/tutorials/qwiic Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ In this tutorial you will learn how to use the Qwiic connector on the Arduino UN
14
14
15
15
We will walk through the concept of I2C, and how it relates to the Qwiic ecosystem.
16
16
17
- You'll learn
17
+ You'll learn what Qwiic is, as well as how to set it up and get started making your own Qwiic system with the Arduino UNO R4 WiFi.
18
18
19
19
![ The Qwiic connector of the Arduino UNO R4 WiFi] ( ./assets/Qwiic-connector.png )
20
20
@@ -71,7 +71,30 @@ This *can* get problematic in some instances depending on the library developed
71
71
In most cases, however, you will be able to select the ` Wire1 ` object when initialising the library in a fashion similar to this:
72
72
73
73
``` arduino
74
- libraryName.begin( &Wire1 );
74
+ Wire1.begin();
75
+ libraryName.begin( Wire1 );
76
+ ```
77
+
78
+ For example, when using SparkFuns AHT20 library, your setup function could look something like this:
79
+ ``` arduino
80
+ #include <Wire.h>
81
+
82
+ #include <SparkFun_Qwiic_Humidity_AHT20.h>
83
+
84
+
85
+ void setup(){
86
+ Serial.begin(115200);
87
+
88
+ Wire1.begin(); //Join I2C bus
89
+
90
+ //Check if the AHT20 will acknowledge
91
+ if (humiditySensor.begin( Wire1 ) == false)
92
+ {
93
+ Serial.println("AHT20 not detected. Please check wiring. Freezing.");
94
+ while (1);
95
+ }
96
+ Serial.println("AHT20 acknowledged.");
97
+ }
75
98
```
76
99
77
100
## Summary
You can’t perform that action at this time.
0 commit comments