Comparing LEGO SPIKE Prime Programming : Which Is Best for Robotics Competitions? - 2
by sunata-s0907 in Circuits > Robots
20 Views, 0 Favorites, 0 Comments
Comparing LEGO SPIKE Prime Programming : Which Is Best for Robotics Competitions? - 2

Does the Programming Environment Affect Precision? A 360° Rotation Test
When using LEGO SPIKE Prime in robotics competitions, does the choice of programming environment impact movement precision?
To investigate this, I conducted an experiment comparing different programming environments.
Supplies
1 PC with Windows 10 or 11 operating system.
Tested Programming Environments
I compared the following four environments:
- Word Blocks (SPIKE App 3) → Download here
- Python (SPIKE App 3) → Download here
- Python (Pybricks) → More info
- C Language (spike-rt) → GitHub repository
Robot Configuration

For the test, I used a car-type robot with the following setup:
- Left motor: Port A
- Right motor: Port B
Test Method

To compare the environments, I conducted the following test:
✅ Command the robot to rotate 360° using a specified motor angle
✅ Measure the difference between the target and actual rotation angles
✅ Perform 10 trials for each environment and calculate the average error
✅ The same logic was used for all environments
Program Code

Python(SPIKE App3)
Python(Pybricks)
C Language (spike-rt)
Results: Which Environment Was Most Precise?

Here are the average rotation errors (smaller is better):
1️⃣ 12° - C Language (spike-rt)🏆
2️⃣ 13° - Python (Pybricks)
2️⃣ 13° - Python (SPIKE App 3)
4️⃣ 14° - Word Blocks (SPIKE App 3)
Additionally, I measured the error fluctuation range (consistency):
1️⃣ 2° - Python (SPIKE App 3) 🏆
2️⃣ 3° - C Language (spike-rt)
2️⃣ 3° - Word Blocks (SPIKE App 3)
4️⃣ 5° - Python (Pybricks)
Key Takeaways:
C Language (spike-rt) had the most accurate rotation (smallest error)
Python (SPIKE App 3) had the most stable results (smallest variation)
Want to Try C Programming on LEGO SPIKE Prime?
If you’re interested in trying C on SPIKE Prime, there are beginner-friendly learning materials available. As of March 2025, a trial version is also accessible—give it a try!
To See More
If you're interested in more LEGO SPIKE Prime experiments with C language, check out this related article:
- Enhancing LEGO SPIKE Prime Line Follower With C: Speed & Stability Comparison
- Introducing SPIKE-RT: the C Language Software Platform for LEGO SPIKE Prime
- Comparing LEGO SPIKE Prime Programming: Which Is Best for Robotics Competitions? - 1
- Comparing LEGO SPIKE Prime Programming: Which Is Best for Robotics Competitions? - 3 (Coming Soon)
🔹 More tests are planned, including further evaluations for robotics competitions. Stay tuned for future updates! 🚀