กลับไปหน้ารวมไฟล์
spaceship-interface-217ded-en.md

Sci-Fi Dashboard: The Spaceship Interface

The Spaceship Interface is an official project from the Arduino Starter Kit book. It’s designed to teach beginners about variables and multiple digital outputs in a fun, theme-driven way rather than a dry academic exercise.

Spaceship Interface

The Cinematic Experience

Imagine the bridge of a sci-fi ship.

  • Normal State: Two green LEDs blink synchronously, indicating the ship is operating normally.
  • The "Red Alert": The user presses and holds a big red button (The "hyperdrive" or "missile launch").
  • The Engine Sequence: Suddenly, the green LEDs shut off. Two red LEDs begin alternately flashing rapidly, simulating a countdown or engine ignition sequence.

If the push button is pressed, the Green LED is turned OFF and the Red LEDs blink alternatively. Otherwise, the Green LED is turned ON and the Red LEDs are turned OFF.

Hardware Needed

  • Arduino Uno: The mission commander.
  • LEDs: 2 Green, 2 Red (or any colors you like).
  • Push Button: The Main Action Trigger.
  • 220-ohm and 10k-ohm Resistors.

Software Concepts: Local vs Global Variables

This project introduces the if/else statement in a highly visual way. It also teaches you about Global Variables (variables declared at the very top of your sketch) to track the state of the system, making the loop() function much cleaner and easier to read.

Try simulation using TinkerCAD circuit.

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Arduino IDE"
author: "SBR"
category: "Basic Electronics"
components:
  - "1x 5 mm LED: Green"
  - "1x Resistor 10k ohm"
  - "1x Breadboard (generic)"
  - "1x Arduino UNO"
  - "2x 5 mm LED: Red"
  - "1x Push Button"
  - "1x Jumper wires (generic)"
  - "3x Resistor 1k ohm"
description: "If Push Button is pressed, Green LED is turned OFF and Red LEDs blink alternatively. Otherwise Green LED is turned ON and Red LEDs are turne"
difficulty: "Easy"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX1/5hCCLNCrOcSzTUxm/YAsgcsbspal2x4waURaO8ue8nos4UBQbunJBrhn3EpdF/y0Wv/zRDqOggjRvNUkfl6CjMC/V8/dc5D4="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/spaceship-interface-217ded_cover.jpg"
lang: "en"
likes: 12
passwordHash: "1ddebc41f766bd9fdfb20784c8f4eee4dded37fa83b49629e80917e034e2495d"
price: 299
seoDescription: "Build a Spaceship Interface with Arduino. Learn how to control Green LED and Red LEDs using a Push Button with code examples."
tags:
  - "starter kit"
title: "Spaceship Interface"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/2Af41OAreMA"
views: 35237