Interaction with Multiple Webduino Boards

It is really simple to interact with multiple Webduino boards. In the Web programming logic, Webduino boards can be seen as "functions", and the components or sensors can be seen as "variables". So when the boards go online, all the functions will be executed, You will need to use Webduino Blockly Editor to do the exercises.

In this tutorial, you will be using an LED and an Ultrasonic sensor. If you want to learn more about their applications, check out the tutorials:

1) Project Example 1: Project Example 1: Control a Single LED
2) Project Example 5: Project Example 5: Use An Ultrasonic Sensor

Instructions for using the Webduino Blockly

First, place the "Board" blocks in the workspace, and mark the "Series" checkboxes on the boards that you want to be connected.

連動多塊 Webduino 開發板

Place LED blocks in each stack, and rename them. Make sure to differentiate their names, since they are different items.

連動多塊 Webduino 開發板

Add a "When in a series circuit, do" block to the workspace. Place all of the events within the slot of this block. This is to make sure that all of the events execute after the boards go online.

連動多塊 Webduino 開發板

To make the LEDs blink add "LED set state" blocks and "Delay # seconds" blocks to the stack.

連動多塊 Webduino 開發板

When you've done all the previous steps, check if the board is online (click "Check Device Status") and click on the red execution button "Run Blocks". You will see the two LEDs blinking. (Check your stack setup with this example here: https://blockly.webduino.io/?lang=en#-KZuPowxRuAFQd9EmjeR).

連動多塊 Webduino 開發板

You can also make LED interact with ultrasonic sensor, just connect one of the boards to an ultrasonic sensor. Here we connect board B to an ultrasonic sensor. The distance detected by the ultrasonic sensor on board B will control the LED on board A.

連動多塊 Webduino 開發板

Then create an event within a "When in a series circuit, do" board. Set up a stack so that when the sensor detects a distance less than 10 centimeters the LED will turn off.

連動多塊 Webduino 開發板

Again, check if the board is online (click "Check Device Status") and click on the red execution button "Run Blocks". You will see the LED light up when there is an obstacle in front of ultrasonic sensor! (Check your stack setup with this example here: https://blockly.webduino.io/?lang=en#-KZuJMsjp5KPXiJBlG6m).

More information :