Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • AI for Simple Python Scripts

AI for Simple Python Scripts

First AI Script

Asking for a Script

Again, if you want to try these techniques yourself, you can currently use ChatGPT as was done here, or Bing.

User
Can you write Python programs for the micro:bit?

ChatGPT
Yes, I can help you with that! The micro:bit uses a programming language called MicroPython, which is a version of Python designed for microcontrollers like the micro:bit. Here’s a simple example program that makes the micro:bit display a heart:

from microbit import *

display.show(Image.HEART)

This program uses the micro:bit’s built-in display and Image modules to show a heart on the LED matrix. You can copy and paste this code into the micro:bit editor, and then download it to your micro:bit.

Feel free to ask if you have any questions or if you’d like help with a specific task!

Testing the AI-generated Script

  • Enter the two-line script into the micro:bit Python Editor.
  • Run the script by clicking the Send to micro:bit button.
  • Did it work as ChatGPT described, by displaying a heart?
  • If you like, name the script AI_heart and save it.
     

Asking How It Works

User
In simple and concise terms, what is the science behind your ability to write Python scripts for the micro:bit.  In other words, how did it come about that you became able to write scripts in the first place?

ChatGPT
I learned by reading and understanding many examples of Python code for the micro:bit. My training involved analyzing various programming patterns and instructions. I don’t have personal experiences; instead, I generate responses based on patterns learned from a diverse range of sources.

User
Is there a name for that process?

ChatGPT
Yes, the process is called “machine learning.” Specifically, I’m part of a type of machine learning called “unsupervised learning.” During training, I processed vast amounts of text data to learn patterns and relationships, enabling me to generate responses and perform tasks based on that learned information.

 


Printer-friendly version
Asking for More
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn • Built with GeneratePress