Yoshihiro Sato
Published © GPL3+

Unmergeinator – The Excel Cell Merge Annihilator

Merged cells are the root of modern business inefficiency. To restore discipline to Excel, we built the secret weapon: the Unmergeinator.

BeginnerFull instructions provided1 hour49
Unmergeinator – The Excel Cell Merge Annihilator

Things used in this project

Hardware components

M5Stack ATOMS3 Lite
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Just plug in the USB cable.

Plug it in, and the nonsense begins.

Code

M5Stack_Cell_Unmergeinator

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

USBHIDKeyboard Keyboard;

const int buttonPin = 41;  // ボタン
const int led = 35;        // RGB LEDピン(NeoPixel / WS2812想定)

#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strip(1, led, NEO_GRB + NEO_KHZ800);

bool active = false;

void setup() {
  auto cfg = M5.config();
  M5.begin(cfg);
  strip.begin();
  strip.show();
  strip.setPixelColor(0, strip.Color(0, 255, 0));
  strip.show();
  USB.begin();
  Keyboard.begin();
  pinMode(buttonPin, INPUT_PULLUP);
}

void loop() {
  // ボタン押下
  if (digitalRead(buttonPin) == LOW && !active) {
    active = true;

    // 赤点滅、間隔縮小
    float interval = 1000;  // 1秒
    while (interval > 300) {
      strip.setPixelColor(0, strip.Color(255, 0, 0));
      strip.show();
      delay(interval);
      strip.setPixelColor(0, 0);
      strip.show();
      delay(interval);
      interval -= 50;  // 徐々に短く
    }

    // 白点滅 + セル結合解除
    strip.setPixelColor(0, strip.Color(255, 255, 255));
    strip.show();

    // Ctrl + A
    Keyboard.press(KEY_LEFT_CTRL);
    Keyboard.write('a');
    Keyboard.releaseAll();
    delay(100);

    // Alt → H → M → C
    Keyboard.press(KEY_LEFT_ALT);
    Keyboard.releaseAll();
    Keyboard.write('h');
    delay(500);
    Keyboard.write('m');
    delay(500);
    Keyboard.write('c');
    delay(500);

    // Ctrl + Home
    Keyboard.press(KEY_LEFT_CTRL);
    Keyboard.write(KEY_HOME);
    Keyboard.releaseAll();

    // 徐々に緑に戻す
    for (int g = 0; g <= 255; g += 5) {
      strip.setPixelColor(0, strip.Color(0, g, 0));
      strip.show();
      delay(20);
    }
    active = false;
  }

  // 普段の緑点滅
  if (!active) {
    strip.setPixelColor(0, strip.Color(0, 255, 0));
    strip.show();
    delay(500);
    strip.setPixelColor(0, 0);
    strip.show();
    delay(500);
  }
}

Credits

Yoshihiro Sato
3 projects • 1 follower
PC Instructor

Comments