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.