Yoshihiro Sato
Published © GPL3+

Creating the Most Ridiculous Useless Joke Tool with M5Stack

Made with M5Stack AtomS3 Lite, this one-button USB device types random fortunes into Word. No code, just absurd joy.

BeginnerFull instructions provided30 minutes168
Creating the Most Ridiculous Useless Joke Tool with M5Stack

Things used in this project

Hardware components

ATOMS3 Lite 
M5Stack ATOMS3 Lite 
×1

Software apps and online services

Arduino IDE
Arduino IDE
2.3.6

Story

Read more

Schematics

Just plug in the USB cable.

Plug it in, and the nonsense begins.

Code

uranaiUSBDevide

C/C++
ArdinoIDE
#include "USB.h"
#include "USBHIDKeyboard.h"

USBHIDKeyboard Keyboard;
const int buttonPin = 41;  // ATOM S3のボタンGPIO

// ==== Overall Luck ====
const char* overallLuck[] = {
  "Overall Luck\n\"Today, you are like a quiet flame—gradually influencing those around you. Move forward steadily without rushing, and unexpected allies may emerge along the way.\"\n",
  "Overall Luck\n\"Patience will reward you today. Small steady steps bring bigger success than rushing.\"\n",
  "Overall Luck\n\"Your calm energy attracts stability. Focus on balance rather than speed.\"\n",
  "Overall Luck\n\"Flexibility brings opportunities—be ready to adjust your path gracefully.\"\n",
  "Overall Luck\n\"Today’s quiet effort plants seeds for tomorrow’s growth.\"\n"
};
int overallCount = 5;

// ==== Love Luck ====
const char* loveLuck[] = {
  "Love Luck\n\"A moment of silent understanding may arise. Rather than acting, attune yourself to the rhythm of the other.\"\n",
  "Love Luck\n\"Gentle words carry deep meaning today—let kindness guide your tone.\"\n",
  "Love Luck\n\"Shared laughter may open doors more than serious talk.\"\n",
  "Love Luck\n\"By giving space, you allow closeness to grow naturally.\"\n",
  "Love Luck\n\"A subtle gesture may reveal more than a direct confession.\"\n"
};
int loveCount = 5;

// ==== Work Luck ====
const char* workLuck[] = {
  "Work Luck\n\"In unclear roles, your ability to clarify structure will shine.\"\n",
  "Work Luck\n\"A hidden challenge may reveal your hidden strength.\"\n",
  "Work Luck\n\"Listen before acting—solutions may already be around you.\"\n",
  "Work Luck\n\"Your steady focus earns respect today.\"\n",
  "Work Luck\n\"By organizing chaos, you create trust and momentum.\"\n"
};
int workCount = 5;

// ==== Financial Luck ====
const char* financialLuck[] = {
  "Financial Luck\n\"Focus on flow rather than figures—unexpected gains may come from unlikely places.\"\n",
  "Financial Luck\n\"A small overlooked resource may suddenly become valuable.\"\n",
  "Financial Luck\n\"Think circulation, not accumulation—sharing may bring returns.\"\n",
  "Financial Luck\n\"Avoid rushing into quick deals—patience reveals better timing.\"\n",
  "Financial Luck\n\"Trust the rhythm of exchange; value moves in cycles.\"\n"
};
int financialCount = 5;


void typeText(const char* msg) {
  for (int i = 0; msg[i] != '\0'; i++) {
    Keyboard.print(msg[i]);
    delay(50); // 文字ごとに遅延
  }
  Keyboard.println();
}

void setup() {
  pinMode(buttonPin, INPUT_PULLUP);
  USB.begin();
  Keyboard.begin();
  randomSeed(esp_timer_get_time()); // ランダム初期化
}

void loop() {
  if (digitalRead(buttonPin) == LOW) {
    delay(50); // デバウンス
    if (digitalRead(buttonPin) == LOW) {
      // 4カテゴリそれぞれ1つずつ選んで出力
      typeText(overallLuck[random(0, overallCount)]);
      typeText(loveLuck[random(0, loveCount)]);
      typeText(workLuck[random(0, workCount)]);
      typeText(financialLuck[random(0, financialCount)]);

      delay(1500); // 連打防止
    }
  }
}

Credits

Yoshihiro Sato
3 projects • 1 follower
PC Instructor

Comments