Every inventor began with one small project. Pick one and bring your idea to life today!
Great inventors and great teachers all started with one small step. Take yours today!
The same kits we use in 40+ school labs โ grab yours and build something youโre proud of.
Log in to continue
Real programmers have a workshop full of tools โ and so do you! In TinkerPy Code you write your program, the compiler checks it, the simulator runs it on a virtual board and Upload sends it to your real board over WiFi or Bluetooth.
Integrated Development Environment: one app with every tool for coding โ editor, checker, tester and uploader. TinkerPy Code is your IDE.
Checking every line of your code and turning it into machine code the board understands. Simulator and Upload open only after a good Compile.
A problem the compiler cannot fix by itself. It is shown in red on that line: ERROR: โฆ, with the line number in the red bar at the bottom.
Small slips (a capital letter, = instead of ==, a missing colon) that Compile fixes for you and explains in yellow: AUTO_CORRECT: โฆ
A virtual board on your screen. Press buttons, move sliders and watch LEDs, buzzers and motors โ no hardware needed.
Sending the compiled code to your board, over WiFi (Device ID + board password) or Bluetooth (board close by, TinkerPy Mega).
Press play or tap each step to follow a program from your screen to the board.
Switch between the two ways of uploading and read what each one needs.
# Give your pins easy-to-remember names
i1 = set_name("button")
o1 = set_name("lamp")
# ===== Button lamp =====
# This code block executes only once
setup:
button = set_input(push_button, active_low)
lamp = set_output(led)
# This code block executes forever
loop:
If button = ON
lamp = ON;
else:
lamp = OFF
wiat(100)Fix-the-bug challenge: this button lamp was typed in a hurry. Can you spot all five mistakes before you press Compile? Look at lines 14, 15 and 18.
14 if button == ON: โ AUTO_CORRECT: Fixed capital letters (TinkerPy words are lowercase; ON/OFF are capitals); Changed '=' to '=='; Added missing ':' 15 lamp = ON โ AUTO_CORRECT: Removed ';' (TinkerPy doesnโt need it) 16 else: 17 lamp = OFF 18 wiat(100) โ ERROR: Unknown function 'wiat(...)'. Pick one: wait(โฆ) Red bar at the bottom: 1 error โ line 18: Unknown function 'wiat(...)'.
What Compile shows. Four slips were fixed by themselves (yellow AUTO_CORRECT notes on lines 14 and 15). One real error is left on line 18: wiat is not a TinkerPy word. Tap the Pick one button wait(โฆ) or fix the spelling yourself, then press Compile again.
# Give your pins easy-to-remember names i1 = set_name("button") o1 = set_name("lamp") # ===== Button lamp ===== # This code block executes only once setup: button = set_input(push_button, active_low) lamp = set_output(led) # This code block executes forever loop: if button == ON: # when button is ON lamp = ON # turn lamp ON else: # otherwise lamp = OFF # turn lamp OFF wait(100) # pause here for 100 milliseconds before continuing
The fixed program after a second Compile: Compile Success! Now press Simulator, then Run, and press or HOLD the button widget to light the lamp. When it works, press Upload.
Pilots practise for many hours in flight simulators before they fly a real plane. You test in the simulator before the real board.
Even expert programmers see red errors every day. The skill is not โno mistakesโ โ it is reading the message and fixing it calmly.
Tinku, the AI teacher in TinkerPy Code, explains your program out loud while the line he is talking about lights up โ and you can pick his voice.
Type the hurried button lamp exactly as shown, mistakes and all. Press Compile and read every yellow and red note. Fix the last error, compile again and test it in the simulator. Then hide three new bugs for a friend to find.
๐งฐ You need: TinkerPy Code, a friendBuild the button lamp in Circuit Connections (push button on i1, LED on o1). Test it in the Simulator, then in AI Simulation on ๐ฃ Step. Only when it works, upload it to a real board over WiFi.
๐งฐ You need: TinkerPy Code, a TinkerPy board, button and LED modulesThe first compiler was built in the early 1950s by Grace Hopper. Before compilers, programs were written very close to machine code โ long lists of numbers and short codes!
5 quick questions to check yourself โ free with your TinkerPy account.
Log in