Connect two 16×16 WS2812 RGB LED matrices together and connect them to the 1-WIRE output and an external power supply.
Convert the R1BBIT logo into a 15×16 pixel format using the built-in editor.
Write a small piece of code to animate the logo.
Write a small piece of code to display SCD41 sensor readings as scrolling text.
// Size: 15x16, Format: 1-bit Mono (1bpp), 30 bytes
// Bitmap image data for 15x16 R1BBIT logo (monochrome)
CONST IMG
02800D801B0036006C00D80FFE3FFE600DD05FB1BF007E7CEC019FFF1FFC
END_CONST
// Declare variables
VAR I, CO2, T, F, H, COL
// I – loop counter
// CO2 – CO₂ value from SCD41 sensor (ppm)
// T – temperature in Celsius
// F – temperature in Fahrenheit
// H – humidity in %
// COL – color variable for matrix elements
VAR STR$ // String variable for scrolling text
// Initialize SCD41 sensor
// T and H will be updated every 5000 ms (5 seconds)
// CO2 is automatically updated by sensor driver
SCD41_INIT(T,H,5000)
// Initialize 16x16 LED matrix
// "V" – vertical orientation
// "BL" – first LED position (Bottom-Left)
// "RR" – row direction
MATRIX_INIT(16,16,"V","BL","RR")
// Clear matrix (fill with black)
MATRIX_FILL(0)
// --------------------------------------------------
// Intro scrolling text
// --------------------------------------------------
FOR I=32 TO -150 STEP -1
COL=RGB888(100,30,0) // Warm orange color
MATRIX_TEXT(I, 0, "HI I'M R1BBIT",Font_11X18, COL)
MATRIX_UPDATE // Refresh display
NEXT
// --------------------------------------------------
// Logo fade-in animation
// --------------------------------------------------
COL=RGB888(0,224,45) // Bright green color
// Fade-in effect (brightness increases)
FOR I=1 TO 200 STEP 3
MATRIX_BITMAP(8, 0, #IMG, 15, 16,1,I,COL,1)
// Draw bitmap:
// X=8, Y=0
// Width=15, Height=16
// 1bpp format
// I controls brightness/intensity
MATRIX_UPDATE
NEXT
// Fade-out effect (brightness decreases)
FOR I=200 TO 0 STEP -4
MATRIX_BITMAP(8, 0, #IMG, 15, 16,1,I,COL,1)
MATRIX_UPDATE
NEXT
// --------------------------------------------------
// Main loop – sensor data scrolling
// --------------------------------------------------
WHILE (1)
// Convert Celsius to Fahrenheit
F=T*9/5+32
// Scroll sensor data across display
FOR I=32 TO -400 STEP -1
COL=RGB888(50,50,20) // Soft yellow color
// Build scrolling string
STR$="TEMP:"+F.0+"F HUMIDITY:"+H.0+"% CO2:"+CO2.0+"ppm"
// .0 formats value as integer (no decimals)
MATRIX_TEXT(I, 0, STR$, Font_11x18, COL)
MATRIX_UPDATE
NEXT
WEND // Endless loop