-
Notifications
You must be signed in to change notification settings - Fork 0
Exercises
Can you create a variable named "age" and set its value to 10? Then, print the value of the variable on the screen.
Suppose you have a variable called "score", and its initial value is 5. Can you update it to 15 and then display the new value?
Create two variables, "num1" and "num2", and assign them the values 8 and 12, respectively. Then, create a third variable, "total", that stores the sum of these two numbers. Finally, print the value of "total".
A shop sells one apple for 3 coins. Create a variable "applePrice" and set it to 3. Then, create another variable "totalCost" and set it to the price of 4 apples (by multiplying applePrice by 4). Print "totalCost".
You have two variables, "x" (set to 5) and "y" (set to 10). Can you swap their values so that "x" becomes 10 and "y" becomes 5? Print both variables to verify the swap.
Create a Blockly program that calculates the sum of all numbers in a given list.
Expected Result:
- Input: [5, 10, 15, 20]
- Output: 50
Hints:
- Use create list with to define the list.
- Use a for each item in list loop to iterate.
- Use a variable (sum) to accumulate the total.
Write a Blockly program that finds the largest number in a list.
Expected Result:
- Input: [12, 45, 7, 32, 9]
- Output: 45
Hints:
- Initialize a variable (max) with the first element.
- Loop through the list and compare each element with max.
- Update max if a larger number is found.
Create a Blockly program that reverses the order of elements in a list.
Expected Result:
- Input: ["A", "B", "C", "D"]
- Output: ["D", "C", "B", "A"]
Hints:
- Use an empty list (reversed_list).
- Loop from the end of the original list and append elements to reversed_list.
Write a Blockly program that counts how many even numbers are in a list.
Expected Result:
- Input: [3, 8, 12, 7, 4]
- Output: 3 (since 8, 12, and 4 are even)
Hints:
- Use a counter variable (even_count).
- Check each number using if (number % 2 == 0)
Create a Blockly program that removes duplicate values from a list.
Expected Result:
- Input: [5, 2, 5, 8, 2]
- Output: [5, 2, 8]
Hints:
- Use an empty list (unique_list).
- For each item, check if it’s already in unique_list before adding.
Create a shape that simulates rolling a pair of dice. Each time the program runs, and when you use twist gesture it should randomly generate a numbers between 1 and 6 (inclusive), representing the result of each die. The shape should then display the results and ask if the user would like to roll again. to exit from the game you can use swipe right gesture.

tskin_ex1.mp4
This is the link for solution to exercise 1
Create a shape to simulate a game of Rock, Paper, Scissors. The game will prompt the player to choose rock, paper, or scissors by using gestures.
The Tactigon Shape will randomly select its choice. The game will then display both choices using emojis and determine the winner based on the rules.
- Rock - push
- Paper - up
- Scissor - swipe right

tskin_ex2.mp4
This is the link for solution to exercise 2
Create a shape to control the braccio to pick an object from a known position and place it in another location.
Please use a small lightweight object (e.g., a block or toy) placed at a fixed position.
braccio_ex1.mp4
This is the link for solution to exercise 1
Move the arm through a predefined path while "avoiding" imaginary obstacles.
braccio_ex_2.mp4
Hints: Try placing obstacles near the Braccio device, then use the Move block to navigate the arm without collisions. This is a great way to test precision and control!
This is the link for solution to exercise 2
Use the Iron boy command block to make Iron-boy move. Try with something simple like "wave" or "celebrate". the movement will be repeated as long as the program is running.
here's the solution: https://github.com/TactigonTeam/Tactigon-Shape/wiki/Solutions#exercise-1-command-loop
Try creating a Shape connecting the TSKIN gestures to Iron-Boy commands. Every time you make a gesture or touch, make it walk forward.
20250512_150753_2.mp4
here's the solution: https://github.com/TactigonTeam/Tactigon-Shape/wiki/Solutions#exercise-2-first-steps
Prerequisites
- Please make sure to log in to the Zion platform before starting any exercises related to Zion.
- You can follow this link for a step-by-step guide on How to Log in to Zion
- You have to connect with the Braccio device How to connect the Braccio device
You need to have the Ultrasonic Distance Level Sensor for this exercise. Make sure that this sensor is connected to Zion via the gateway. If you have any questions, please contact one of our Tactigon crew members.
- Get distance value from the NI310_UDL.
- Get the value and store it in a variable
- Check if the distance is less than 100. If so, please print 'Anomaly Detected!!!' in the console.
Hints:
- Use get device last telemetry block from Zion Api category
- Select the right device. In this exercise, you can select the NI310_UDL device
- To test, you can place one of the objects very close to the Ultrasonic Distance Level Sensor.

ex1.mp4
This is the link for solution to exercise 1
Now let’s move on to a very interesting exercise. Your goal is to send some data to Zion — easy peasy!
For this exercise, you'll need our Braccio device.
The overall goal of this function is to send a move command to the Braccio, and once the arm moves, it sends telemetry data to Zion to update the status of the device (moving or not).
As you can see, there's a Move block that controls the Braccio's movement. While the Braccio is moving, you can send data to Zion — for example, setting movement to true. But as soon as Braccio is stopped, you need to make another request to Zion by setting movement to false.
You can use following blocks related to Braccio but for this exercise, you can use Move block

ex2.mp4
This is the link for solution to exercise 2
It's time to retrieve some attribute data from a specific device. Let's use Tiltmeter for this exercise.
As you can see, we have attributes like angle_x, angle_y, and angle_z. Your goal is to fetch these attributes and print them to the console.

In this example, your output should be x = 20, y = 8 and z = 1.2
Hints:
- Use get device attribute block from Zion Api category
- Select the right device. In this exercise, you can select the NI320_TILT_1device
- To test, you can check the current values for angle_x, angle_y, and angle_z in the Zion web application and compare the values with the console or output. (change the position of the Tiltmeter so you can see different output)
ex03.mp4
This is the link for solution to exercise 3
Now, let’s say that for every movement of the Braccio device, we want to update all the values — x, y, and z.
The reason for this is simple: by constantly updating these values, we always have the latest position of the Braccio, and we know exactly where it is at any given moment.
For this exercise, you'll need our Braccio device.
As we mentioned in Exercise 1, when you move the Braccio device, you can send all the values related to position, for example, the value_x, value_y, and value_z values.

As you can see, there's a Move block that controls the Braccio's movement. You pass some numbers or values to the Braccio to define its motion, right?
While the Braccio is moving, you can also send data to Zion — for example: value_x = 50, value_y = 50, value_z = 20.
This is a great exercise to both control the Braccio and update attribute data with new values.
ex4.mp4
This is the link for solution to exercise 4
Now, let's move on to alarms. Suppose we have some sensors that measure certain conditions. In this case, we can use the Get Alarm Device block to check if there's an alarm or not.
In this exercise, you can select any device you want and use it, and you can use the Is Empry block to check whether an alarm is triggered.
Hints:
- You can use one of our sensors. For example, we have the Ultrasonic Distance Level sensor to measure distance. Use the Zion web app to configure alarm settings.
- To test, you need to check if the response array is empty. If it's not empty, it means we have a bomb.
ex5.mp4
This is the link for solution to exercise 5
Now, let's say we want to send or trigger an alarm. You can use the Create or Update Alarm Device block. Select the device you want to send the alarm from and set the alarm status.
Once you send the alarm, you'll be able to view it through the Zion web app.

ex6.mp4
This is the link for solution to exercise 6
Use the temperature sensor (NI300_TH) to trigger Braccio's gripper
Challenge: If the temperature exceeds 30 celsius, open gripper; if below 30 celsius, close gripper ( 30 celsius is an example; you can define your own threshold)
Hints:
- Use get device last telemetry block from Zion Api category
- Select the right device. In this exercise, you can select the NI300_TH device
- This challenge showcases how robots can interact with their environment by using sensor data to make real-time decisions.
Use tiltmeter (angle_x) to implement emergency stop
Challenge: If tilt angle_x is positive, then move Braccio to (100,100,50) safety position
Hints:
- Use get device last telemetry block from Zion Api category
- Select the right device. In this exercise, you can select the NI320_TILT_1 device
- This exercise is very useful because it adds a safety feature, letting the robot detect instability and react to prevent damage or accidents.
Use distance sensor and active server attribute to control Braccio's Z-axis height
When an object is close to the Ultrasonic Distance Level sensor and the sensor's server attribute is set to active: true, move the Z-axis to a lower position; otherwise, move it to a higher position.
In this screenshot, you can see that there is an edit icon on the right side along with the attributes. You can simply edit the value.

Hints:
- Use get device last telemetry block from Zion Api category
- Use get device attribute block from Zion Api category
- Select the right device. In this exercise, you can select the NI310_UDL device
- You can change the value of the active using the Zion web application.
Use tiltmeter data and all three axes to keep a platform level
Challenge: Continuously move Braccio with comapring angle_x, angle_y, and angle_z values of Tiltmeter. (You can map values from Tiltmeter to Braccio)
Hints:
- Use get device last telemetry block from Zion Api category
- Select the right device. In this exercise, you can select the NI320_TILT_1 device
- To test, you can rotate or change the position of the tiltmeter device. Once it changes, the Braccio device should move accordenly