Skip to content

Commit f070007

Browse files
committed
Update built-in-rgb.md
1 parent ed9b22f commit f070007

File tree

1 file changed

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

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ There is a good chance that you have already seen or heard the term **RGB**. RGB
4343

4444
The RGB component is used for many different purposes. They can be particularly useful to signify the state of something. For example: if we want to signify that everything is OK, we can simply change the color to green, if there's a minor error we can change the color to yellow, and if there is a major error we can change it to red.
4545

46-
### Controlling the Built-in RGB on the MKR WiFi 1010
46+
### Controlling the Built-in RGB
4747

4848
The built-in RGB is located right next to the **NINA-W102** Wi-Fi module on the MKR 1010 board.
4949

@@ -59,11 +59,13 @@ Controlling the RGB on the MKR WiFi 1010 is slightly different from any previous
5959
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:
6060

6161
```arduino
62-
WiFiDrv::pinMode(25, OUTPUT);
63-
WiFiDrv::pinMode(26, OUTPUT);
64-
WiFiDrv::pinMode(27, OUTPUT);
62+
WiFiDrv::pinMode(25, OUTPUT); //define GREEN LED
63+
WiFiDrv::pinMode(26, OUTPUT); //define RED LED
64+
WiFiDrv::pinMode(27, OUTPUT); //define BLUE LED
6565
```
6666

67+
***Please note that in some older versions, the green and red LEDs are swapped (pin `25` and `26`).***
68+
6769
And to control them inside the `loop()`, we simply use:
6870

6971
```arduino

0 commit comments

Comments
 (0)