blockly_icon

Learning with Blockly

Blockly is an excellent starting point for learning programming, especially if you have no prior experience. If that sounds like you, you’re in the right place. In Doly’s Blockly platform, you’ll explore the fundamental concepts of programming without needing to worry about complex syntax. Simply drag and drop blocks to build your programs, and Blockly will automatically generate the correct code for you.

Blockly Workspace

To access your Blockly workspace, open the mobile app and tap “Blockly.” Then, select the appropriate workspace level: Beginner, Standard, or Advanced.

Let’s start with the layout of the workspace. On the left side, you can see the blocks, and on the right side, you’ll find the buttons to control your project.

Types of blocks

In the advanced Blockly workspace, you can use five different types of blocks. The other workspaces offer fewer block types to match their difficulty level. Each block type has a unique shape, connector, and socket design, which helps you see how they fit together.

Selected blocks

You can tell which block you’re currently working with because it will be highlighted with a yellow border.

Managing Your Blockly Workspace and Program

Blockly lets you easily drag and drop blocks directly into your workspace. If you ever want to delete a block or a group of connected blocks, simply drag them to the trash bin in the bottom-right corner, or right-click and select Delete Block.” You can also right-click to duplicate them, or add comments for better organization.

doly_sv

Doly Blocks

Get ready to bring your ideas to life, your Doly is waiting for your command.

In this section, you’ll use a collection of Doly Blocks to design how your robot moves, reacts, and interacts. These blocks come in different types, serving as both action and function blocks that let you build sequences of behavior. With just a few drags and drops, you can shape Doly’s every move and unlock a digital world full of possibilities.

Eye Blocks

Eye Blocks allow users to visually express emotions, actions, and reactions through Doly’s animated digital eyes. Available blocks and functionalities vary by user level.

At the Beginner level, there are multiple predefined Eye Expression blocks available. Each of these blocks sets both of Doly’s eyes to a specific static or animated look. The expression blocks are fully icon-based and designed for simplicity, allowing young or new users to easily select visual emotions.

At the Standard level, users work with an eye expression block. After selecting this block, a drop-down menu appears that lets the user choose an eye expression category. Each category includes a group of related expressions, making it easier to find the right look for Doly.

This level includes the Standard block mentioned above, and adds advanced customization option blocks. Users can now adjust the eye style and color, set a background (either a color or an image), and control the position of each eye using X and Y coordinates between 0 and 240.

Sound Blocks

Sound blocks allow users to give Doly a voice, personality, and presence through audio. With these blocks, users can make Doly express emotions, play fun animal noises, trigger musical tones or alarms, and even speak custom text using text-to-speech. Sound blocks help bring Doly to life by syncing voice and sound effects with actions, making interactions more engaging, expressive, and fun.

At the Beginner level, there are multiple predefined Sound blocks available. Each of these blocks plays a specific sound, such as a laugh,  cheer, or silly noise. The sound blocks are fully icon-based and designed for simplicity, making it easy for young or new users to choose a sound without needing to read or adjust any settings.

At both the Standard and Advanced levels, users work with two types of Sound blocks. The first block lets them choose from a variety of preset sound effects or music. After selecting this block, users can use the drop-down menu to pick a sound category—such as emotions, animals, effects, or musical tones. Each category includes a set of related sounds, making it easy to find the right one for Doly. The second block is for text-to-speech, allowing users to type a short message that Doly will speak out loud in a friendly robot voice.

Drive Blocks

Drive blocks control Doly’s movement through its track-based drive system. These blocks allow users to move Doly forward, backward, or turn left and right at different speeds and over set distances. Whether navigating a path or performing a dance, Drive blocks bring Doly’s movements to life.

At the Beginner level, Drive blocks let users move Doly in simple directions using easy, icon-based blocks. Each block makes Doly go forward, backward, or turn left or right for a short distance or a set angle. Just pick a block and watch Doly move!

At the Standard level, Drive blocks give users greater control over how Doly moves. Users can set the distance in millimeters, choose a rotation angle between 0 and 360 degrees, and adjust the speed and direction using value blocks. These options allow for smoother and more precise movements, making it easier to create planned paths, turns, and choreographed actions.

At the Advanced level, Drive blocks include all the features of the Standard level, offering even greater control over Doly’s movement. In addition to setting direction, speed, and rotation angle, users can define exact X and Y coordinates for Doly to move to. They can also control acceleration and braking behavior, as well as fine-tune speed and force. This level enables highly precise and dynamic motion, perfect for complex navigation and advanced programming.

Note: The XY coordinate system resets each time Doly is placed back on the ground.

Arm Blocks

Arm blocks are used to control the movement of Doly’s arms. Depending on the level, users can make Doly perform simple gestures or adjust the position of each arm more precisely. These blocks allow Doly to move its arms in different ways to match the actions or expressions in a program.

At the Beginner level, users can choose from a few simple, predefined Arm blocks. Each block performs a basic motion with one arm, such as raising the left arm or lowering the right arm. The blocks are icon-based and easy to use, with no settings to adjust. Only one arm moves at a time, and users cannot control the speed, or perform actions with both arms simultaneously.

At both the Standard and Advanced levels, Arm blocks allow users to control the position and speed of Doly’s arm movements. Users can set the arm angle to a specific value, making it possible to raise or lower each arm to an exact position. They can also adjust how fast the arm moves, allowing for smoother or quicker motions depending on the program. Both arms can be controlled separately, giving users more flexibility than the Beginner level.

Light Blocks

Light blocks are used to control the LEDs located on Doly’s hand tips. These blocks allow users to change the color of the lights and, at higher levels, adjust effects like blinking or fading. Light blocks can be used to add visual feedback, signals, or mood to a program. The level of customization depends on the user’s selected level.

At the Beginner level, users can select a single color using a simple, icon-based Light block. The chosen color is applied to both of Doly’s hand lights at the same time. This block is designed to make it easy for new users to add color to their programs with just one step.

At the Standard level, Light blocks offer more control. Users can choose from a larger color palette and decide whether to light up the left hand, right hand, or both. This allows for more variety and flexibility in how colors are used in a program.

At the Advanced level, Light blocks include all the features of the Standard level, with additional customization options. Users can create complex light animations for each hand, control how long the lights remain on, and apply fading effects to make the lights appear, disappear, or transition smoothly. These features allow for more dynamic and expressive lighting control in Doly’s programs.

Note: This new block set also allows users to create rainbow lighting effects.

Time Blocks

Time blocks are used to control delays between actions in a program. They allow users to create pauses so that each step happens at the right moment. This helps with timing Doly’s movements, sounds, lights, or expressions. The way timing is controlled depends on the selected user level.

At the Beginner level, users can use simple delay blocks that pause the program for a short, preset amount of time, such as 1, 2 or 10 seconds. These blocks are icon-based and do not require any input. They help space out actions but offer no customization.

At both the Standard and Advanced levels, users can set custom delay times using number inputs. They can decide exactly how long Doly should wait before moving to the next action. Time can be entered in milliseconds (1 sec = 1000 ms), giving more control over the pacing of the program.

Loop Blocks

Loop blocks are used to repeat a set of actions multiple times. They help make programs shorter and more efficient by avoiding the need to stack the same blocks over and over. Looping is useful for creating patterns, repeated motions, or timed behaviors.

Loop blocks are not available at the Beginner level. Users must manually repeat actions by placing blocks one after another.

At both the Standard and Advanced levels, Loop blocks work the same way. Users can place a group of blocks inside the loop and set how many times the cycle should repeat. This makes it easy to create repeated actions like blinking, waving, or playing sounds in a controlled loop.

Servo Blocks

Servo blocks are used to control external servo motors connected to Doly. These blocks are useful for advanced users who want to add mechanical parts like moving accessories, attachments, or head tilts.

Servo blocks are not available at the Beginner and Standard levels.

At the Advanced level, users can use Servo blocks to control up to two connected servo motors. They can select the servo channel and set its position to a specific angle between 0° and 240°. This enables precise control over the movement of external parts, making servos ideal for custom extensions or add-ons.

Note: We strongly recommend using original Doly servos for your custom projects to prevent any potential damage to your Doly. You can purchase genuine servos from our online shop.

GPIO Blocks

GPIO (General Purpose Input/Output) blocks allow Doly to interact with external electrical components, such as buttons, sensors, or LEDs. These blocks are designed for advanced users who want to expand Doly’s hardware capabilities.

GPIO blocks are not available at the Beginner and Standard levels.

At the Advanced level, users can use GPIO blocks to read input signals or send output signals through Doly’s GPIO pins. They can set a pin to HIGH or LOW to control connected devices, or read the state of a pin to trigger actions. These blocks allow Doly to be part of more complex projects that include custom electronics or interactive hardware.

Logic Blocks

Logic blocks are used to add decision-making to Doly’s programs. They allow Doly to react to conditions, compare values, and choose between different actions. These blocks are essential for responsive behaviors.

Note: Logic blocks are only available for reading GPIO pin states.

Logic blocks are not available at the Beginner and Standard levels.

At the Advanced level, users can use Logic blocks to create conditional actions using if/then structures. They can compare values such as numbers, states, or sensor inputs. This makes it possible for Doly to make decisions based on what’s happening in the program or environment.

Event Blocks (Beta)

Event blocks allow Doly to respond when something specific happens. These blocks are useful for making programs interactive by triggering actions based on events.

Event blocks are not available at the Beginner and Standard levels.

At the Advanced level, users can use Event blocks to trigger actions when certain events occur. This block set is experimental and currently in testing, and only Complete Event blocks are available. A Complete Event block can be linked to other blocks (such as value blocks) and can contain action blocks. It is triggered when the linked block has finished its operation. These blocks help create programs that don’t just follow a fixed sequence but react to the environment in real time.

Blockly Limitations

Blockly’s limitations include potential performance issues with large projects, restrictions on complex context-sensitive block connections, and challenges in creating certain advanced features. Although Blockly helps demonstrate the basics of programming, it uses a very different underlying structure than real code, which can sometimes lead to logical errors. Some known limitations are listed below:

 

  • It is not possible to have two or more instances of the same block type active at the same time. If the code sequence is arranged incorrectly, starting a new block of the same type will cancel the previous one and start the new one instead. In some complex projects, this behavior can cause errors in the program flow.

  • In Action blocks, the Start option (with Start Instant and Previous Completed settings) determines how the current block starts in relation to the previous block. For example, if Previous Completed is selected, the block will start only after the immediately preceding block has finished, regardless of whether earlier blocks have finished.

  • A maximum of 65,535 blocks can be defined at the same time.