Skip to content

Commit 7cb5e43

Browse files
authored
Merge pull request #1 from ngolf/ngolf-patch-1
Update built-in-rgb.md for pin colour assignments
2 parents af825aa + 05622b2 commit 7cb5e43

File tree

1 file changed

+8
-8
lines changed
  • content/hardware/01.mkr/01.boards/mkr-wifi-1010/tutorials/built-in-rgb

1 file changed

+8
-8
lines changed

content/hardware/01.mkr/01.boards/mkr-wifi-1010/tutorials/built-in-rgb/built-in-rgb.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Controlling the RGB on the MKR WiFi 1010 is slightly different from any previous
5656
#include <utility/wifi_drv.h>
5757
```
5858

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:
6060

6161
```arduino
6262
WiFiDrv::pinMode(25, OUTPUT);
@@ -67,16 +67,16 @@ After we have included it, it is pretty straightforward. The RGB component uses
6767
And to control them inside the `loop()`, we simply use:
6868

6969
```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
7272
WiFiDrv::analogWrite(27, 0); //BLUE
7373
```
7474

7575
Or, if we want to use `digitalWrite()` (for simply turning on with full brightness), we can write it like this:
7676

7777
```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
8080
WiFiDrv::digitalWrite(27, LOW); //BLUE
8181
```
8282

@@ -107,8 +107,8 @@ The sketch can be found in the snippet below. Upload the sketch to the board.
107107
#include <utility/wifi_drv.h>
108108
109109
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
112112
WiFiDrv::pinMode(27, OUTPUT); //define blue pin
113113
}
114114
@@ -143,8 +143,8 @@ void loop() {
143143

144144
Shortly after we have uploaded the sketch to the board, we should see the RGB start changing colors. The correct order should be:
145145

146-
- Green.
147146
- Red.
147+
- Green.
148148
- Blue.
149149
- Off.
150150

0 commit comments

Comments
 (0)