🎂 Houdini 150 🚚 FREE FEDEX SHIPPING from 397 USD 🌎 WORLDWIDE SHIPPING for 25 USD
Congratulations on taking the first step to become a MagiScript programmer! In this section, we'll guide you through the process of running your very first MagiScript program.
Requirements:
function main() {
atom.led('rgb*');
}
What is this code about? We have declared a function called main
, this function will be called once you upload the app to your device. Then there's an atom.led
call with the parameter of an rgb*
pattern. It will turn on the RGB led and set it to red, green, and blue for 50-50 ms, and repeat the pattern from the beginning.
There is an App Store button available in the editor. Click on it, and you will see a list of available mini-apps. Select any of them.
You can compile and upload the selected code to Atom. Before that, make sure you set your PeekSmith or SB Watch device names in the code when it is necessary. If you only have one PeekSmith or SB Watch around, you can use * (star) instead of the name.
With the latest firmware, you can persist your Atom scripts. It means that your mini-app will be saved to Atom's Flash drive, and will be loaded when Atom starts. To do this, just upload your code, and click on the Persist button.
Currently, the persisted Atom app loads after 5 seconds when you turn on the device.
There are several important notes:
exit()
call to your app, and the app will stop running, so turns OFF after 30 seconds.atom.led('')
call your main function to disable this.Now that you've successfully run a program, you're ready to start exploring the capabilities of MagiScript. In the following sections, we'll show you how to create your own mini-apps using MagiScript by examples and cover more advanced topics like variables, data types, and functions.
If you encounter any issues while running your MagiScript program, we are ready to help in the MagiScript Facebook group. Happy coding!