Block Types

EduBlocks is a "block-based" programming language. This means instead of writing lines of code to program, we use "blocks". Each block has a specific category that describes what its purpose is. In EduBlocks, each block type corresponds to a library in CircuitPython.

Each CircuitPython program you run needs to have a lot of information to work. The reason CircuitPython is so simple to use is that most of that information is stored in other files and works in the background. These files are called libraries

For example the NeoPixel library allows us to control the NeoPixels on the board. Without importing the library, we cannot access the functionality.

Basic

  • Basic blocks are core functionality of CircuitPython. With these blocks, we can create loops, conditional statements, functions, and more.

Variables

  • This section allows you to create variables. To create a variable, you simply click the Create Variable.. button, give the variable a name and then two blocks will appear which will allow you to use the variable in your code

Digital

  • This library lets us manage digital inputs and outputs. For example this library lets us access the buttons on the CPX and use them to trigger outputs like changing the colors of NeoPixels. Read more about the library here

Analog

  • These blocks allow us to interface with the hardware on the board by converting from digital to analog and vice versa. For example if we want to read the voltage of a pin on the CPX we would use this block type. Read about the differences between analog in and out here and here.

Neopixel

  • This library allows us to control the properties of NeoPixels LEDs such as brightness, color and more. Read more here.

Touch

  • With touch blocks, we can access the capacitive touch capabilities of different inputs. On the CPX there are multiple capacitive touch inputs we can use to trigger different events, for example, playing a sound. It's all done with our fingers! Learn more here.

Servo

  • This library allows us to access and control any connected servo motors. Read more here.

Audio

  • Audio blocks allow us to create our own musical tones as well as play sound files. More here.

PWM

  • The PWM (Pulse-Width Modulation) library allows us to control components like leds and servos in a more precise way than just on or off. For example we can fade LEDs and change speed of servos. More here.

Dotstar

  • Control brightness, color and other attributes of another type of led. Dotstars are great for light painting! More here.

Advanced

  • Library for various advanced functionality like controlling data storage.

CPX Easy

  • By clicking "Extentions" on the top right of the interface, we can add one more library entitled "Circuit Playground Easy"
  • This library allows us to perform tasks that the other libraries allow with much simpler code. These blocks are great for first timers. More here.
This guide was first published on Feb 05, 2019. It was last updated on Feb 05, 2019. This page (Block Types) was last updated on Nov 11, 2019.