This tutorial will teach you to update the display in Magicbit using Toit.
let's get start,
1. Sign upfirst of all, you should create a free Toit account to get access to the Toit cloud. Go to toit.io, click the Start Now button, and follow the sign-up instructions.
Connect Magicbit dev.board with a USB cable to your computer.
On this page you can connect the Magicbit dev.board with Toit for that you should click theYes button,
After you can click yes,let's start button
select your device COM Port
Enter WiFi SSID and Password
You can download Visual Studio Code here.
When you have downloaded and installed Visual Studio Code, get the language extension for Toit either from the Visual Studio Marketplace or from the open marketplace.
The Toit Language Extension provides built-in language support for the Toit programming languages, but also a new device view, and a serial view from where you can interact directly with your devices. The Toit language extension also provides helpful commands for the developer, such that you can run or deploy Toit programs on your devices directly from Visual Studio Code.
5.Install the Toit CLI
Download the Toit installer for Windows and follow the instructions in the installer.
#Check
Type toit in a terminal window.
toitInstall the latest released Toit SDK on your computer by running the CLI command:
toit doctor fix#Toit doctor
toit doctorreports the health status of your local Toit installation. Its output should look like this, if you have installed the Toit language extension for Visual Studio Code:
Toit health:
[OK] Toit SDK
[OK] Visual Studio Code
[OK] Toit CLIYou must create a project folder and open it in VSCode.
Both the color-tft and ssd1306 packages have some helpful examples which you can see by cloning the github repos linked above. We will assume that you have a get_display.toit file in your project, which might look something like the following. Details will depend on your hardware configuration, in particular which pins and bus you are using to connect your display.
Example contents of get_display.toit
Deploying a Toit app on your device means that the Toit code in the toit file will be executed repeatedly according to the scheduling defined in wether.yaml. In this case, when the app is installed on the Magicbit device and if the device reboots.
Deploy the Toit app named ABCApp on your device with the following command. Replace device-name with the actual name of your device.
toit deploy -d device-name wether.yamlAfter that, You can see your App (toit program) in the console.




Comments