Arduino UNO in Emerson

Ryan Torvik - February 14, 2025 - 4 minute read

Tulip Tree Technology

Bringing Arduino UNO to Emerson

We’re excited to introduce a major addition to our emulator: Arduino UNO support! With this update, you can now emulate an Arduino UNO directly within Emerson. Plus, we’ve integrated Arduino IDE support, making the workflow seamless.

Want to see it in action? Check out our Demo video below:

Getting Started

Install Emerson and the Arduino Plugin

Before running Arduino sketches in Emerson, you need to install the latest version:

  1. Go to our website and click the Download button in the top right corner. Fill out the form and an email will give you the complete source code and key to install the Emerson docker image.

  2. Extract the package:

    tar xvf Emerson-CE.tar
    
  3. Navigate into the extracted folder and run the install script:

    ./install
    

    This installs the necessary scripts, the license key, and our Arduino IDE plugin.

Running Your First Sketch

We have a few examples that you can run inside of /Emerson-CE. Let’s first check out the blink example.

Ensure Arduino UNO is selected as the board in ToolsBoard.

Load the Sketch into Emerson

  1. Inside of your blink sketch, compile and export the binary (Ctrl-Alt-S) by selecting SketchExport Compiled Binary.
  2. Open the Command Palette (Ctrl-Shift-P) and select Emerson: Load Sketch.
  3. In your browser, go to http://localhost:10314 to access Emerson’s project interface.

Debugging and Observing Execution

Inspecting LED_BUILTIN on PORTB5

The blink example toggles LED_BUILTIN, which is mapped to PortB5 or Pin 13 on the Arduino UNO.

Navigate to PortsRegisters in the device box to all of your port and pin data.

device-tree

Hit play to start the bootloader process then pause. To see the Port B bit 5 toggle, use the Emerson CLI. You can use --help in the Emerson Console for all commands.

Step through execution step 40 to observe the PortB register changing from 0 to 0x20 (0b00100000), showing that bit 5 is toggling.

(Note: Pin-based GPIO is still in development, but direct register manipulation works!)

Reloading Sketches

Lets say we want to modify our sketch to toggle a variable instead.

bool toggle = 0;
void setup() {
  Serial.begin(9600);
}

void loop() {
  toggle = 1;
  Serial.println(toggle);
  toggle = 0;
  Serial.println(toggle);
}

Re-export the binaries and reload the sketch using Emerson: Reload Sketch in the Command Palette. Refresh your browser to load the changes from your sketch into Emerson.

Open the tty0 console to see serial outputs from USART (input support coming soon!).

Play the sketch and see the variable toggle!

Stopping the Emerson Server

When finished, stop the server with Emerson: Stop Server in the Command Palette.

Important: Closing the Arduino IDE does not stop Emerson. You must manually stop it using the command above.

Exploring Other Examples

Try running other Arduino examples in Emerson:

Try It Yourself

With Arduino UNO support, Emerson provides a powerful testing environment for embedded developers. Download the latest version and start experimenting today!

Download Emerson | Emerson-CE Github | Join the discussion on Slack

Happy sketching!

Previous Post Next Post