Hello and welcome back to Surilli playground. Today we are here for something interesting. In this tutorial, we will be programming our Surilli Basic M0 through block programming using Snap4Arduino or S4A. We will switch ON/OFF our on-board LED on the bases of data coming from and LDR just from demonstration purpose.
Snap4Arduino is a modification of the Scratch visual programming language that lets you seamlessly interact with all versions of Surilli boards.
Let's cut the theory now and jump into the playground.
Note: If you are using this Surilli Basic for the first time, follow our Startup Guide for Surilli WiFi and then move to step 1.STEP 1: Setting Up Arduino IDE
Make sure you have selected the right port, board and processor for the Surilli as shown in the picture below and it is programmable (compile and upload “Blink” from File>Examples>Digital>Blink onto your Surilli to check if everything is working fine).
This is a one time setup and is pretty simple. Just download the Arduino sketch named "S4AFirmware16" given at the end of tutorial and upload it onto your Surilli Basic.
Now that your Surilli is ready to be programmed with block programming, Download S4A from here and install it onto your PC. Run S4A and move to the next step.STEP 2: The Circuitry
The circuitry is very simple so we will go through it first. Complete your circuit connections and then move on to the next step.
Open S4A (Drag and drop the file into S4A software) on your PC and plug in your Surilli basic that is already running with the "S4AFirmware2016" sketch. Surilli should start appearing (Or just the "Searching board" block disappears) on the right hand side of the S4A software as shown below.
Now, Click the green Button on S4A as shown in the picture above and hit "Space" bar button on your keyboard to run the program.
You can simply change the value in Green Box (from 0-1023). This changes the Light Intensity on which you want the switching to happen ;)
That’s all for now. If you have any queries, visit surilli.io or contact our support. Stay connected with Surilli family for more amazing stuff :)