Robotics · lesson 26 of 30 · free

Debugging robot programs — Robotics for kids

A bug is a mistake in a program; debugging is finding and fixing it. First run the program and watch what goes wrong. Then compare: where should the robot be, and where did it go? A robot that ends up on the wrong side has a left/right mix-up; one that stops short has a wrong number. A square that does not close has the wrong turn angle — it must be 360 ÷ 4 = 90°. Fix one thing at a time and test again, so you know what worked.

▶ Watch how it works

Got it? Practise ↓

Robot tip

Compare and fix one thing — “run the program in your head, compare with what should happen, fix one thing, test again”

  1. Run it, spot what went wrong, find the buggy line, fix one thing, test again.
  2. Wrong side → a turn is the wrong way. Too far or too short → a forward number is wrong.
  3. A shape that does not close → the turn should be 360 ÷ sides; a gap → the repeat number should equal the sides.

Use it for: Every time a robot or a program does something unexpected, coding lessons and robotics competitions.

Worked example: 🐞 This program should draw a regular square (4 equal sides), but the shape does not close: repeat 4 { forward 10 cm; turn right 60° } What should 60 be changed to? → 90

  1. A square has 4 equal turns that add up to 360°.
  2. 360 ÷ 4 = 90, so 60 should be 90.

Check: 4 × 90° = 360° — now the square closes ✓

▶ Watch it animated

✏️ Practice

Work it out in your head or on paper, type the answer and press Check. Stuck? Press “Show me how”.

Right: 0 · Tried: 0

🏁 Lesson 26 test

20 questions. Check each answer, then go to the next one. Get 16 or more right to pass.

🏅 Sign in with Google to earn the 🐞 Robot Debugger badge when you pass — and a certificate when you finish all 10 lessons of Part 3 · Programming robots. You can still take the test without signing in.

🖨️ Robotics Worksheet: Debugging Robot Programs

✨ Free AI tutor

Ask the AI tutor about this lesson

Why does it work? When should you use it? Ask in English, मराठी or हिंदी.

Sign in with Google to ask Free — 20 questions a day.

👩‍🏫 Robotics classes near you — online or at home

Prefer a real teacher? TalentJR teachers take live online classes anywhere in India and visit homes in selected cities. Tell us what you need and our team will call you with timings and fees.

Live online classesSmall groups or 1:1 with a teacher, from home, any city.
Teacher at homeA TalentJR teacher visits your home (selected cities).
At a centreClasses at a TalentJR partner centre near you, where available.
Badges, certificates & gifts A badge for every lesson you pass, a certificate for every part you finish, plus TalentJR Points for daily practice. Electronics & IoT Circuits, sensors and microcontroller boards.