Toit is a modern high-level language designed specifically for microcontrollers
Toit is optimised for live reloading on your microcontroller. Your code runs incrementally as you write it and you get instant feedback. Push changes over your local WiFi in two seconds and reserve your USB cable for charging your phone. You iterate quickly, learn fast, and build better things.
Defining functions
What if you want to say "Hello" a lot without getting your fingers all tired? You should define a function. Calling a function in Toit is as simple as mentioning its name. If the function doesn’t take arguments that’s all you need.
Learn more...hi:
print "Hello World!"
greet name:
print "Hello $name!"
main:
hi
greet "Kasper"
Toit + Jaguar = 🥳
Jaguar is a small application developed by the Toit team, that runs on your ESP32. It enables live reloading and lets you update and restart your ESP32 code over WiFi.
Update your code and restart your ESP32 conveniently over WiFi. No need to flash over serial, reboot your device, or wait for it to reconnect to your network.
Change your code in your editor, update it on your device, and restart it all within seconds.
Updates contain compiled Toit programs that are relocated and installed in flash on the device. Old versions are stopped and their resources are freed automatically.
No ESP32?
The Toit language can also be used on the desktop. In fact, we use it to develop many of the tools that come with the SDK.
Documentation
Learn how to code with Toit and how you can use it in your IoT projects.
Latest news
Toit v2.0.0-alpha.74 release Mar. 30th, 2023
Change ServiceHandler to use gids - not pids. Allow access to gid of started containers. More fine-grained adjustment of metadata size. Add support for adding partitions when flashing through tools/firmware.
Toit v2.0.0-alpha.73 release Mar. 28th, 2023
Simplify algorithm for MD5. Revert service call optimizations.
Toit v2.0.0-alpha.72 release Mar. 27th, 2023
Add support for net.Client.quarantine. Add support for crypto.md5 support. Add storage.Region.stream for streaming reads. Add support for storage.Region based on partitions. Reland stack shrinking during GC. Generate partitions.bin in tools/firmware.
Toit v2.0.0-alpha.71 release Mar. 24th, 2023
Avoid creating new tasks for service calls within a process. Revert stack shrinking during GC.
Toit v2.0.0-alpha.70 release Mar. 24th, 2023
Fix streaming JSON decoder. Sign Windows releases. Shrink stacks during GC. Don't pre-allocate memory for TLS handshake. Upgrade Go to v1.20 for toit.pkg and toit.lsp.
Toit v2.0.0-alpha.69 release Mar. 20th, 2023
Fix version number and thus uuid in stripped snapshots. Fix shutdown for proxied networks with open sockets.
Writing a driver in Toit
Just a few lines of Toit code are needed to reap the full benefits of the Toit ecosystem — without having to rely on firmware developers.
Choosing Toit for your IoT project means that your ESP32-based devices become as easy to program as smartphones: develop your app, deploy it to the devices of your choice, and then update and reinstall as often as needed, even on a shaky connection — all that while the other apps on the device keep running. Welcome to the 21st century, IoT!
Toit meets Visual Studio Code
The extension allows VSCode to provide a rich view of your programs as well as easy access to common functionality like running and deploying apps.