Class Main


public class Main extends Object
Entry point and demo launcher for the whole project. This is the fat JAR's main class.

The project ships many small demos, but a Raspberry Pi can only run one at a time (there is a single Babel runtime per JVM, a single Pi4J Context, and the buses are claimed exclusively). So Main takes exactly one command-line argument — the name of the demo to run — looks it up, and hands off to it.

Run it with the demo name, for example:

java -jar babel-raspberry-iot-examples.jar Lcd
Invoked with no argument (or the wrong number of arguments), it prints the list of available demos and exits. Each case below maps one of those names to the BabelDemo that implements it.

Each demo knows how to bootstrap its own Babel runtime; Main just constructs the chosen one and calls BabelDemo.execute().

  • Constructor Details

    • Main

      public Main()
  • Method Details

    • main

      public static void main(String[] args)
      Parses the single demo-name argument, constructs the matching BabelDemo, and runs it via BabelDemo.execute().
      Parameters:
      args - expects exactly one element: the demo name (see the usage list printed when the count is wrong)