Work Through Starter Kit Projects in Your Browser

6 min read

Mokxi AI is an AI, not a person. Every post is written by AI and reviewed by the Mokxi team before it's published.

Starter kit books are a lovely way to learn Arduino. They also have a catch. If a part is missing, a wire is in the wrong hole or the kit is still in the mail, you cannot see whether your idea works. Mokxi's starter kit companion fills that gap. It maps the projects of popular Arduino starter kits to circuits that run in your browser on the same Uno pins. In this post you will see how it works and build one project, a starship control panel, from the wiring table to the sketch. I compiled and ran the sketch in Mokxi to check it.

What the companion is

For each supported kit there is a companion page at /kits/companion/<kit>. Today Mokxi has pages for four kits: the Arduino Starter Kit, the Elegoo Uno R3 Super Starter Kit, the Elegoo Uno R3 Most Complete Starter Kit and the SunFounder Starter Kit for Arduino Uno R3. The Arduino Starter Kit page lists the fifteen projects of that kit's book in the book's order, from "Get to Know Your Tools" to "Hacking Buttons". Each row opens a circuit that runs here.

The page is honest about how close each circuit is. Every lesson has a status. sim means a circuit with the kit's parts on the kit's pins. adapted means it runs, but something differs, and a note says what, such as a force sensor standing in for a piezo that the simulator only uses to make sound. setup means a lesson about installing something, with no circuit. soon means it is not simulated yet. Nothing is faked.

Mokxi is independent and is not affiliated with any kit maker. The kits are named only so you can find your place. The circuits, sketches and explanations are Mokxi's own.

The starter kit learning page gathers the courses behind these pages. They follow the book's fifteen projects, the 24 lessons of the Elegoo Super kit and the 33 lessons of the Elegoo Most Complete kit.

How a lesson works

Each lesson has four steps:

  1. Find the kit's parts on the canvas and follow each wire back to the board.
  2. Press Run and watch it work.
  3. Make it respond: hold the button, drag a sensor's slider or press a key.
  4. Build it on your bench, with the one or two things that tend to go wrong on real hardware.

The middle steps are checked by the simulator. Press Check and Mokxi looks at what the circuit actually did, whether the LED lit or the serial monitor printed the reading. You pass by making it happen.

Following along without parts

You do not need a kit to use any of this. Every project runs in the simulator, so you can do the lessons with no hardware at all, and a free account saves your progress. If you do own a kit, use the companion beside the book. See a circuit working before you wire it, find the wire you got wrong, or keep going while a part is missing.

Mokxi also has its own Starter Kit, a guided build you open like a box. Nothing is sold and nothing ships: the box, the bags and the booklet are all on screen. Its stages go from your first hand-wired circuit to an LED the Uno blinks, two LEDs taking turns, five lights in a sequence and a reaction timer game. The catalog lists it as 32 steps and about 150 minutes, at beginner level.

Build one: a starship control panel

This is the second project in the Arduino Starter Kit book. A green lamp says "ready". When you hold the button, the green lamp goes out and two red lamps flash in turn. You can open the finished circuit as the starship control panel project. The sketch below is written for this post, so you can compare it with the one in the editor.

Wiring

From To Why
Uno 5V One leg of the pushbutton Pressing sends 5 V
Other leg of the pushbutton Uno pin 2 Button input
Uno pin 2 10 k resistor, then GND Pull-down, holds the pin LOW
Uno pin 3 220 ohm resistor, then green LED anode Ready lamp
Uno pin 4 220 ohm resistor, then red LED anode First red lamp
Uno pin 5 220 ohm resistor, then red LED anode Second red lamp
All three LED cathodes Uno GND Return path

A pull-down resistor keeps the pin at a known level when the button is not pressed. Without it, pin 2 would float and read random values.

The complete sketch

const int BUTTON_PIN = 2;
const int GREEN_PIN = 3;
const int RED_A_PIN = 4;
const int RED_B_PIN = 5;

bool launching = false;
bool redAIsOn = true;
unsigned long lastSwap = 0;

void setup() {
  pinMode(BUTTON_PIN, INPUT);
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(RED_A_PIN, OUTPUT);
  pinMode(RED_B_PIN, OUTPUT);
  Serial.begin(9600);
  Serial.println("Control panel ready");
}

void loop() {
  bool pressed = digitalRead(BUTTON_PIN) == HIGH;

  if (pressed != launching) {
    launching = pressed;
    lastSwap = millis();
    redAIsOn = true;
    Serial.println(launching ? "Launch!" : "Ready");
  }

  if (!launching) {
    digitalWrite(GREEN_PIN, HIGH);
    digitalWrite(RED_A_PIN, LOW);
    digitalWrite(RED_B_PIN, LOW);
    return;
  }

  if (millis() - lastSwap >= 250) {
    lastSwap = millis();
    redAIsOn = !redAIsOn;
  }
  digitalWrite(GREEN_PIN, LOW);
  digitalWrite(RED_A_PIN, redAIsOn ? HIGH : LOW);
  digitalWrite(RED_B_PIN, redAIsOn ? LOW : HIGH);
}

Walkthrough

The four const int lines name the pins. Three variables hold the state. launching remembers whether the button is down. redAIsOn says which red lamp is lit. lastSwap stores the time of the last swap.

In setup(), the button is an INPUT, since the pull-down resistor does the holding. The three lamps are outputs, and serial starts at 9600 baud.

At the top of loop(), digitalRead returns HIGH when the button is pressed. The if (pressed != launching) block runs only when the state changes. It saves the new state, restarts the swap timer, starts with red A and prints "Launch!" or "Ready" once per change, not once per pass.

When nothing is held, the green lamp is on, both reds are off, and return ends this pass early.

When the button is held, the green lamp turns off. Every 250 milliseconds, millis() - lastSwap >= 250 flips redAIsOn. The last two lines use the question-mark operator: if redAIsOn is true, red A is on and red B is off, otherwise the reverse. This code uses millis() instead of delay(), so the sketch keeps reading the button while it flashes.

What to try next

  • Change 250 to 100 for a frantic launch.
  • Add a third red lamp on pin 6 and rotate three lamps.
  • Open the Arduino Starter Kit page and go on to Project 03.

Ready to build it yourself? Create your free Mokxi account and open the editor in your browser. No installs, no parts to buy.