30 Days Lost in Space → Help Center
Coding Concepts — 30 Days Lost in Space Help Center
Component guides, wiring references, code explanations and fixes for the errors people hit most in 30 Days Lost in Space.
Coding Concepts
Programming fundamentals: variables, loops, functions, and logic
- Arrays — Store multiple values in a single variable. Arrays are essential for managing groups of LEDs, sensor readings, melodies, and sequences.
- Bits, Bytes, and Bitwise Operations — Binary makes more sense once you see it as light switches. This is your guide to binary counting, bitwise operators, hex notation, and the practical patterns…
- Debouncing Buttons — When you press a button once and your code registers it five times, that is bounce. Here is what causes it physically, what it looks like in your Serial…
- Functions — Organize your code into reusable blocks. Functions make programs easier to read, debug, and maintain.
- If/Else: Conditional Logic — Make your Arduino make decisions. If/else statements let your code choose different actions based on sensor readings and button presses.
- Loops: for and while — Repeat actions automatically. For loops count through sequences, while loops run until a condition changes. Essential for animations and scanning.
- State Machines — Your Arduino project needs to be in a mode, like locked vs unlocked or waiting vs entering a code.
- The map() Function — Convert a value from one range to another. Essential for translating sensor readings into LED brightness, servo angles, or display values.
- Variables & Data Types — How to store and work with data in Arduino. Learn about int, float, bool, char, and String, the building blocks of every program.
- Working with Strings on Displays — Getting numbers and text to show up correctly on your OLED or 7-segment display. How to convert variables to text, add leading zeros, format sensor readings…
- constrain() — Keeps a number within a range by clamping it. Too low becomes the minimum, too high becomes the maximum.
- millis(): Non-Blocking Timing — Replace delay() with millis() for responsive programs. Learn to run multiple tasks simultaneously without freezing your Arduino.
- random() and randomSeed() — Arduino's random() function does not give you truly random numbers. It gives you the same sequence every time unless you seed it.
- switch/case Statements — When your code needs to handle a bunch of specific values, like which switch position is active or which key was pressed, switch/case keeps things readable…
- tone() and noTone() — How to make your piezo buzzer produce actual sounds, play notes, and build melodies. Includes frequency ranges, a note table, the Timer2 conflict with PWM, and…