You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/01.mkr/01.boards/mkr-wifi-1010/tutorials/built-in-rgb/built-in-rgb.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Controlling the RGB on the MKR WiFi 1010 is slightly different from any previous
56
56
#include <utility/wifi_drv.h>
57
57
```
58
58
59
-
After we have included it, it is pretty straightforward. The RGB component uses 25 (green), 26 (red) and 27 (blue), so we need to define those pins by using the following commands:
59
+
After we have included it, it is pretty straightforward. The RGB component uses 25 (red), 26 (green) and 27 (blue), so we need to define those pins by using the following commands:
60
60
61
61
```arduino
62
62
WiFiDrv::pinMode(25, OUTPUT);
@@ -67,16 +67,16 @@ After we have included it, it is pretty straightforward. The RGB component uses
67
67
And to control them inside the `loop()`, we simply use:
68
68
69
69
```arduino
70
-
WiFiDrv::analogWrite(25, 255); //GREEN
71
-
WiFiDrv::analogWrite(26, 0); //RED
70
+
WiFiDrv::analogWrite(25, 255); //RED
71
+
WiFiDrv::analogWrite(26, 0); //GREEN
72
72
WiFiDrv::analogWrite(27, 0); //BLUE
73
73
```
74
74
75
75
Or, if we want to use `digitalWrite()` (for simply turning on with full brightness), we can write it like this:
76
76
77
77
```arduino
78
-
WiFiDrv::digitalWrite(25, HIGH); //GREEN
79
-
WiFiDrv::digitalWrite(26, LOW); //RED
78
+
WiFiDrv::digitalWrite(25, HIGH); //RED
79
+
WiFiDrv::digitalWrite(26, LOW); //GREEN
80
80
WiFiDrv::digitalWrite(27, LOW); //BLUE
81
81
```
82
82
@@ -107,8 +107,8 @@ The sketch can be found in the snippet below. Upload the sketch to the board.
107
107
#include <utility/wifi_drv.h>
108
108
109
109
void setup() {
110
-
WiFiDrv::pinMode(25, OUTPUT); //define green pin
111
-
WiFiDrv::pinMode(26, OUTPUT); //define red pin
110
+
WiFiDrv::pinMode(25, OUTPUT); //define red pin
111
+
WiFiDrv::pinMode(26, OUTPUT); //define green pin
112
112
WiFiDrv::pinMode(27, OUTPUT); //define blue pin
113
113
}
114
114
@@ -143,8 +143,8 @@ void loop() {
143
143
144
144
Shortly after we have uploaded the sketch to the board, we should see the RGB start changing colors. The correct order should be:
0 commit comments