Shruthi
Published © MIT

Greetify

AI-powered signage that spots you and says hello.

BeginnerFull instructions provided8 hours40
Greetify

Things used in this project

Story

Read more

Schematics

Circuit Diagram

Code

Code

C/C++
#include <Wire.h>
#include "Seeed_Arduino_SSCMA.h"
#include <LiquidCrystal_I2C.h>

SSCMA AI; // SenseCraft AI object
LiquidCrystal_I2C lcd(0x27, 16, 2); // Change address if needed

bool lastState = false; // For avoiding flicker

void setup() {
    Serial.begin(115200);

    lcd.init();
    lcd.backlight();
    lcd.clear();

    if (!AI.begin()) {
        Serial.println("Failed to initialize AI");
        while (1);
    }
    Serial.println("AI Initialized");
}

void loop() {
    SSCMA_Result result;
    if (AI.invoke(result)) {
        bool personDetected = false;

        for (int i = 0; i < result.count; i++) {
            if (String(result.objects[i].name) == "person") {
                personDetected = true;
                break;
            }
        }

        if (personDetected) {
            if (!lastState) { // Only trigger when state changes to detected
                lcd.clear();
                lcd.setCursor(0, 0);
                lcd.print("Welcome to Stark Tower");
                
                // Scroll the text
                for (int pos = 0; pos < 16; pos++) {
                    lcd.scrollDisplayLeft();
                    delay(300); // Adjust scroll speed
                }
            }
        } else {
            if (lastState) { // Only clear when state changes to no detection
                lcd.clear();
            }
        }

        lastState = personDetected;
    }
}

Credits

Shruthi
2 projects β€’ 0 followers

Comments