From the course: Learning CircuitPython with Circuit Playground Express

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Your first script

Your first script - Python Tutorial

From the course: Learning CircuitPython with Circuit Playground Express

Start my 1-month free trial

Your first script

- [Instructor] You saw during the demos that the blink program was a text file. In this video, we'll see how to make changes to a program using our editor Atom. Here's the listing of the blink program. The beginning sets up the environment. First it imports modules or libraries that add functionality. Then it defines how to access the onboard LED. The actual blinking takes place in what's called a while loop, while true repeats all of the lines indented beneath it forever. The loop contains two statements that turn the led on and off. With just on and off, the blink would be way too fast to see. The sleep function is added by the time module and is used here to pause CircuitPython between turning the LED on and off. One more thing, the lines beginning with a hash mark are comment lines. They don't do anything but are very useful in describing how the program works. And that's all there is to it. Now let's go…

Contents