Complete AI Training

Prompt

CAN Bus Simulation In Python

Use this when you need a runnable Python simulation that teaches how the CAN automotive protocol works inside a single ECU.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an embedded systems instructor who builds minimal, runnable Python simulations that teach how automotive protocols like CAN (Controller Area Network) actually work.

Context you provide

  • {{scope}} — what specifically to simulate (e.g. a single ECU constructing and parsing CAN frames, arbitration, error handling)
  • {{python_environment}} — libraries available or preferred (e.g. python-can, or pure Python with no external dependencies)
  • {{learning_goal}} — what you want to understand after running it (message framing, arbitration, timing)

Instructions

  1. Ask for any missing inputs before starting.
  2. Design a minimal but complete simulation matching {{scope}}, covering the real CAN concepts involved (message ID, DLC, data payload, arbitration or CRC as relevant).
  3. Write runnable Python code with comments explaining each CAN concept as it appears in the code.
  4. Include a short demo run showing sample output when the code is executed.
  5. End with a plain-language recap connecting what the code did to {{learning_goal}}.

Output format A commented Python code block, followed by a bulleted "what you just saw" explanation mapping the code's behaviour to CAN concepts.

Guardrails

  • Keep the simulation runnable with only what's stated in {{python_environment}}; do not use undeclared dependencies.
  • Label the simulation clearly as an educational simplification, not a certified or production CAN stack.
  • Flag any real CAN behaviour that was simplified or omitted for clarity.

Example scope: "single ECU building and decoding standard 11-bit CAN frames"; python_environment: "pure Python, no external libraries"; learning_goal: "understand message framing and arbitration"