ESP32 Bit Pirate home
  • General commands
  • Intermediate
  • 5 min
  • Serial CLI

Recipe · Intermediate · General commands

How to chain CLI commands with delays

Use command chaining with || plus delayms or delayus to create small one-line scripts directly in the CLI.

Protocol lab with bus signals and command blocks.
Command chaining is useful for small reproducible bench actions.
Step 1

Commands

These commands are documented as global or quick-start commands.

Result

What it means

If the command returns the expected output, the firmware and terminal session are ready for the next workflow.

Troubleshooting

  • Use delayms when timing does not need microsecond scale.
  • Keep chained commands short and readable.
  • Test the command once before wrapping it in repeat.

Next steps

  • Try the same workflow on a known safe pin or target.
  • Save the useful command as a note or alias.
  • Move to the protocol-specific recipe once the basics work.

Command chaining FAQ

When is a chained command useful?

Use a chain for a short, repeatable bench action: set a mode, run a read-only check, wait, then run another check. It keeps simple tests reproducible without writing a script.

Should I use delayms or delayus?

Use delayms for human-scale waits such as reset timing or device settle time. Use delayus only when the workflow really needs microsecond-scale spacing.

How do I keep chained commands safe?

Test each command alone first, keep the chain short, and start with read-only actions. Do not hide write, erase or transmit actions inside a long chain unless the target and wiring are already verified.

Go deeper