SkillAgentSearch skills...

SplitFlap

No description available

Install / Use

/learn @SahibManjal/SplitFlap
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

License

SplitFlap

SplitFlap enables the use of split-flap displays as train signs following a preset schedule. With a little wiring, a microcontroller, and a small server, convert your room into a train station by making your decomissioned train signs flip as they would in their heyday!

<p align="center"> <img src="flip.gif" alt="split-flaps flipping" /> <br> <a href="https://en.wikipedia.org/wiki/Yamato-Yagi_Station"> Yamato-Yagi station</a>'s split-flap displays flipping </p>

While other attempts have been able to manipulate Split Flap displays to your needs, there has not been an explicit example recreating how these Split Flap displays worked in real-life. By utilizing timetables, mimicking flip behavior from real-world examples, getting live delays for adaptability, and integrating the various types of Solari Split Flaps displays, we have been able to faithfully recreate real-life scenarios.

Setup

Prerequisites

  1. Arduino toolchain (for instance, the official IDE or CLI) and the ArduinoJSON and ArduinoHttpClient packages
  2. ESP32 microcontroller
  3. Destination and stop pattern split-flap displays
  4. Circuitry connecting the ESP32 to the split-flap displays

ESP32 Configuration

Fill in the flippers array in Flipper_Config.cpp (look in Flipper_Config.h for type Flipper):

Flipper flippers[FLIPPER_AMOUNT] = {
  {DESTINATION, <in1>, <in2>, <enable>, <home>, <flipState>, <flipAmount>, <flapPosition>},
  {STOP_PATTERN, <in1>, <in2>, <enable>, <home>, <flipState>, <flipAmount>, <flapPosition>},
};

Each entry corresponds to a split-flap display and includes its FlipperType and the GPIO pins on the ESP32 responsible for controlling it.

There are five possible split-flap types:

  • DESTINATION displays the last stop of a train
  • STOP_PATTERN indicates all stations a train stops at
  • HOUR shows the hour of trains departure
  • TENS_MINUTE and ONE_MINUTE show the tens and ones digit of the minute of a trains departure

REQUIRED: the flippers array must include a DESTINATION and STOP_PATTERN split-flap!

There are four pins used to control each split-flap display:

  • in1 and in2 are for rotating the motor
  • enable is brought HIGH to allow the motor to move
  • home is brought HIGH when the split-flap is at the "home" position

Set the FLIPPER_AMOUNT and LATCH_TIME macros in Flipper_Config.h:

// Milliseconds between consecutive flips for a single split-flap display.
// REQUIRED: must be >= 75 to function properly
#define LATCH_TIME -1
// the number of entries in the flippers array
#define FLIPPER_AMOUNT -1

To achieve speeds similar to flip.gif, set LATCH_TIME=120.

Fill in your WIFI information and server IP address in Network_Config.h:

#define WIFI_SSID ""
#define WIFI_PASSWORD ""

#define SERVER_ADDRESS ""

Timetable

A timetable is a schedule that dictates which flap the split-flaps display at a given time. In our case, it's a JSON array of the form

[
  {
    "location": "Blank",
    "hour": 5,
    "minutes": 8,
    "destinationFlap": 0,
    "stopFlap": 0
  },
  {
    "location": "L-Haibara",
    "hour": 5,
    "minutes": 38,
    "destinationFlap": 31,
    "stopFlap": 39,
    "comment": "Actual end is Yamato-Asakura"
  },
  ...
]

Each entry is a train stopping at the station, whose details are displayed on the split-flap displays.

  • location is the final destination
  • hour and minute indicate the departure time
  • destinationFlap and stopFlap indicate the flap position for the DESTINATION and STOP_PATTERN split-flaps respectively

More specifically, timetables should match this schema and entries must satisfy the following constraints:

  • destinationFlap and stopFlap indicate flap positions via the number of flips from their "home" flap
  • hour must be between 0 and 23
  • minutes must be between 0 and 59

In Server/timetable/, create two timetables for weekdays and weekends/holidays called weekday.json and weekend.json respectively.

Install

Clone this repository on a server of your choice (RPi, AWS, locally) and run start.sh. Then upload the files in ESP32/ on to the ESP32.

Previous Versions

WARNING: parts of the setup instructions no longer apply. You should still be able to read the code to fill in the appropriate details.

Roadmap

  • [x] Make split-flap display flip
  • [x] Follow a hardcoded schedule
  • [x] Migrate code from Arduino to ESP
  • [x] Support multiple split-flap displays
    • [x] destination
    • [x] stopping pattern
    • [x] time
  • [x] Setup server for selecting timetable
  • [x] Setup ESP32 communication with server
  • [ ] Webscrape for live delays and cancelations
  • [ ] Fix initial index of motor mismatch
  • [ ] Configure code for control box

References

  1. Kintetsu Corporation Timetables
  2. Kintetsu Corporation Livetracking
  3. Helpful SplitFlap Reverse Engineering Blog Post
  4. Japanese Holidays

Contact

Encountered a bug you'd like to report? Fill out a GitHub issue. Need help/support? Have an idea for a new feature? Make a GitHub Discussion!

View on GitHub
GitHub Stars10
CategoryDevelopment
Updated9d ago
Forks0

Languages

C++

Security Score

85/100

Audited on Mar 23, 2026

No findings