CodeSpace: Using AI

CodeSpace: Using AI

The structured curriculum content in CodeSpace is designed to teach students without AI assistance. We strongly believe that beginning students need to experience typing (not pasting) the code, and working through their mistakes on their own. Similar to working math problems, we learn through our failures as much as through our successes.

  • Should you use AI to help you learn to code?
  • Moreover, with the emergence of powerful AI, should students still learn to code at all?

Great questions! See our blog post AI and the Future of STEM Education for our take on this (and why we answer emphatically YES! to both).

A Word of Caution

When your goal is learning, be careful not to use AI to avoid "productive struggle." Students must first attempt to solve problems on their own before seeking AI assistance.

Imagine if you had a Robot Personal Trainer at the gym. It could be really helpful!

  • Maybe it could help you with your form, or suggest a new exercise.
  • And if you ask, maybe it could even do the workout for you!
  • But if you're trying to get stronger, this is pointless.

If you want to get stronger at coding, it's up to YOU not to cross that line.

Robot Personal Trainer illustration

AI for Understanding Code

If, after struggling for several minutes, the solution is still elusive, an LLM can help guide you. Here's a prompt template for getting help without getting the answer handed to you:

I'm learning Python, and I wrote the following code. I'm trying to [insert your goal here, e.g., "make the LEDs light up in sequence every time a button is pressed"] but I'm not sure if it works correctly or why it's not behaving as expected. Please help me understand what this code is doing, point out any mistakes or improvements, and explain how I could fix or complete it. Here's my code: # Your Code Here!
Tip Notice that this prompt asks the AI to explain and guide, not to write the solution for you. This is the key to using AI as a learning tool.

AI for Remix Projects

Remixes are where you can use AI more liberally. Using concepts you've learned to build imaginative projects is exciting, but sometimes it's hard to know where to start. AI can be your creative partner — a sounding board for ideas and an expert assistant to help make them reality.

But remember, the goal is to learn and create, not just to get a quick answer!

The following are prompts designed for each Firia Labs product. First paste the prompt shown, along with the Python modules downloaded from the links below. Follow that up with your remix ideas and questions.

Note The Python modules listed below are only the beginning. Be sure to upload any additional modules you use in your remixes, so the LLM can help you with those as well!

CodeAIR

Paste this prompt into your LLM chat box, and upload the files codeair.py and flight.py (linked below):

I'd like your help writing Python code for the CodeAIR, an educational drone from Firia Labs that runs CircuitPython. I've attached two Python modules used to control the CodeAIR: * codeair.py: provides access to the drone's hardware (buttons, LEDs, camera, etc.) * flight.py: provides an interface to the flight controller CPU, for sensor access and flight control. It includes a global variable fly, which is an instance of MotionCommander adapted from the Crazyflie Python library. Most student programs begin with: from codeair import * from flight import * Please read and use the attached modules to help me write or debug code that will run directly on the CodeAIR. When responding, assume that students are coding on a beginner level. Provide clear, commented code and explanations suitable for educational use.

Download the Python modules:

codeair.py — scroll to bottom for file link flight.py — scroll to bottom for file link

CodeX

Paste this prompt into your LLM chat box, and upload the file codex.py (linked below):

I'd like your help writing Python code for the CodeX, a handheld educational device from Firia Labs that runs CircuitPython. I've attached a Python module used to control the CodeX: * codex.py: provides access to the device's hardware (LCD, buttons, LEDs, sensors, etc.) Most student programs begin with: from codex import * Please read and use the attached module to help me write or debug code that will run directly on the CodeX. When responding, assume that students are coding on a beginner level. Provide clear, commented code and explanations suitable for educational use.

Download the Python module:

codex.py — scroll to bottom for file link

CodeBot (Physical and Virtual)

Paste this prompt into your LLM chat box, and upload the file botcore.py (linked below):

I'd like your help writing Python code for the CodeBot, an educational 2-wheeled rover from Firia Labs that runs CircuitPython. I've attached a Python module used to control the CodeBot: * botcore.py: provides access to the device's hardware (motors, buttons, LEDs, sensors, etc.) Most student programs begin with: from botcore import * Please read and use the attached module to help me write or debug code that will run directly on the CodeBot. When responding, assume that students are coding on a beginner level. Provide clear, commented code and explanations suitable for educational use.

Download the Python module:

botcore.py — scroll to bottom for file link
Back to blog