Arduino TKJHAT
Arduino library for Pico HAT extension board
Loading...
Searching...
No Matches
RGBLed.ino
1
/*
2
RGB LED Example
3
4
This example demonstrates how to use the RGB LED on the TKJHAT.
5
The RGB LED can be controlled by setting the intensity of the red, green, and blue components.
6
7
Circuit:
8
- RGB LED integrated in Pico HAT
9
10
created 2026
11
*/
12
13
#include "TKJHAT.h"
14
15
// Create an instance of the TKJHAT class
16
TKJHAT
hat;
17
18
19
// RGBLed.begin() initializes the RGB LED, and RGBLed.write() sets the color of the LED
20
// First value is for red, second for green, and third for blue. Each value can range from 0 to 255.
21
void
setup() {
22
hat.
rgbLed
.
begin
();
23
hat.rgbLed.write(10, 0, 10);
24
}
25
26
// In this example, we don't need to do anything in the loop
27
void
loop() {
28
}
RGBLed::begin
void begin()
Initialize the RGB LED.
TKJHAT
Main interface for accessing TKJHAT board features.
Definition
TKJHAT.h:35
TKJHAT::rgbLed
RGBLed rgbLed
RGB LED.
Definition
TKJHAT.h:53
examples
RGBLed
RGBLed.ino
Generated by
1.16.1