ArduinoStudio

Dev Mode: the Arduino Code Behind Your Blocks

Every project is a real Arduino sketch. Dev mode shows it, lets you edit it with the blocks following along, and lets you take it to the Arduino IDE.

Open it

In the editor toolbar, click Arduino code (the </> button). The sketch docks at the bottom of the editor, under the canvas. Drag its top edge to make it taller. It works on your own projects, on other people’s public projects and in the live demo.

The code is generated by fixed rules, not by AI. Every change on the canvas regenerates it straight away, and the same project always gives the same sketch.

Code and blocks point at each other

  • Select a block on the canvas and its lines light up in the code.
  • Click a line in the code and its block is selected.
  • While Play runs, the lines of the running block light up.

Edit both ways

On a project you own, the code is editable and the canvas follows as you type.

Change a value

Change a pin, HIGH or LOW, a delay, a loop count, a message or a Check’s threshold, and that block’s setting changes. Each edit is one undo step, and the server checks the new value the same way it checks the settings panel. Only the values you touched are written back.

Add a block by typing a line

Type a new statement inside a sequence and the matching block appears at that spot: delay(500); adds a Wait, digitalWrite(13, HIGH); adds an LED, analogWrite(9, 128); adds a half-bright LED, servo9.write(90); adds a Servo, tone(8, 440, 200); adds a Piezo and Serial.println("Hi"); adds a Message. Write a line the way the sketch already writes that block: a line on a DC motor’s pin adds a DC motor block, and a relay line needs the comment the sketch puts after it, such as // on, NO. Blocks you can add this way: Standard LED, Servo, DC motor, Relay and Piezo buzzer, plus Wait and Message.

Remove a block by deleting its lines

Delete every line of a block and the block is removed. Half-deleted or half-typed lines change nothing, so a typo can’t delete a block.

What stays on the canvas

  • Loops and Checks are added on the canvas. Typing a new for loop or if in the code doesn’t create one.
  • A line that can’t become a block, such as a new pinMode or a renamed function, is marked with the reason and changes nothing.
  • On someone else’s project, typing opens the same Clone to Edit prompt as clicking a block. In the demo it points you to a free account.

Copy or download the sketch

Click Copy, or Download .ino to save a file named after your project. Open it in the Arduino IDE and upload it like any sketch. The board then runs your project on its own, without the browser.

Uploading a sketch replaces the Firmata firmware ArduinoStudio uses to drive the board live. To use the board from the app again, let the setup wizard reinstall the firmware when you next connect. See supported boards.

Where the sketch differs from the app

The panel lists a note for anything the sketch does differently. The common ones:

  • Several sequences run side by side in the app. On the board they run one after another, because a board does one thing at a time.
  • Nothing set to repeat means the sketch runs once when the board powers up, then stops.
  • Message blocks print to the Serial Monitor at 9600 baud instead of showing on the canvas.
  • A Check that fails ends that pass of the sequence, the same as in the simulator.

Which blocks become code

Wait, Loop, Check and Message always do. For the hardware blocks, the table shows what you get. A block marked “Not yet” becomes a // TODO comment with a note, never a guess.

BlockIn the sketchType a line to add itNotes
Standard LEDYesYesdigitalWrite for on and off; analogWrite for Brightness on a PWM (~) pin.
ServoYesYesservoN.write(angle) with the Servo library. Not on ESP32 or ESP8266 boards, where that library does not build.
ButtonYesNoRead by the Check after it. Uses the internal pull-up, so pressed reads LOW.
PhotoresistorYesNoanalogRead in the Check after it.
RGB LEDYesNoOne analogWrite per colour, written for a common-cathode LED. The sketch says how to flip it for common anode.
DC motorPartlyYesanalogWrite for Speed on a PWM pin; full speed on any other pin. Forward only: the block stores no direction pin.
RelayYesYesdigitalWrite, with the level flipped for a normally-closed relay.
Piezo buzzerYesYestone(pin, Frequency, Duration).
ESCNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
SwitchYesNoRead by the Check after it, like the Button.
PotentiometerYesNoanalogRead in the Check after it.
Proximity sensorNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
IR motion sensorNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
JoystickNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
ThermometerNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
HygrometerNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
BarometerNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
AccelerometerNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
GyroNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
IMUNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.
CompassNot yetNoBecomes a // TODO comment with a note. Keep it in the app, or write that part yourself.

Next steps

  • Build the circuit for your sketch with the Wiring view.
  • Not sure where to start? Let the AI Builder make the blocks, then read the code it produced.
  • New to ArduinoStudio? Start with Getting Started.

See the editor in action with a guided demo, no account or install needed: open the demo