Seeed
Published © MIT

Light Up Your Valentine with Sparkling RGB Matrix

Valentine's Day is coming, do you meet someone who fell in love at first sight?

BeginnerFull instructions provided1 hour1,213

Things used in this project

Hardware components

Seeeduino V4.2
Seeed Studio Seeeduino V4.2
×1
Base Shield V2
Seeed Studio Base Shield V2
×1
Seeed Studio Grove - RGB LED Matrix w/Driver
×1
Seeed Studio Grove - Water Sensor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Untitled file

C/C++
#include "grove_two_rgb_led_matrix.h"

#define SENSOR_PIN            2
#define INTERVAL              500

#define WAIT_MATRIX_READY()   \
  delay(1000)
#define EMOJI(array, index)   \
  (array + index * 8)
#define EMOJI_COUNT(array)    \
  (sizeof(array) / sizeof(array[0]) / 8)

GroveTwoRGBLedMatrixClass matrix;
uint64_t example[] = {

  0xffffffffffffffff,
  0xffffffffffffffff,
  0xffff00ffff00ffff,
  0xff000000000000ff,
  0xff000000000000ff,
  0xffff00000000ffff,
  0xffffff0000ffffff,
  0xffffffffffffffff,
 
  0xffffffffffffffff,
  0xffe9e9ffffe9e9ff,
  0xe9e900e9e900e9e9,
  0xe9000000000000e9,
  0xffe900000000e9ff,
  0xffffe90000e9ffff,
  0xffffffe9e9ffffff,
  0xffffffffffffffff,
 
  0xffdedeffffdedeff,
  0xdee9e9dedee9e9de,
  0xdee900e9e900e9de,
  0xde000000000000de,
  0xdee900000000e9de,
  0xffdee90000e9deff,
  0xffffdee9e9deffff,
  0xffffffdedeffffff
};

void setup() {
  Wire.begin();
  Serial.begin(9600);
  pinMode(SENSOR_PIN, INPUT);
  
  WAIT_MATRIX_READY();
}

void loop() {
  if (digitalRead(SENSOR_PIN) == LOW) {
    for (uint8_t i = 0; i < EMOJI_COUNT(example); ++i) {
      matrix.displayFrames(EMOJI(example, i), INTERVAL, false, 1);
      delay(INTERVAL);
    }
  }
}

Credits

Seeed

Seeed

101 projects • 159 followers
Seeed R&D Team

Comments