Interfacing Dabble with evive

Interfacing-Dabble-with-evive
About This Tutorial
In this tutorial, we learned how to control actuators or send commands to them wirelessly via a Smartphone using Dabble.
Tutorial Info

In this video, we’re going to take a look at Dabble, a versatile project interaction app, the dedicated blocks for Dabble in PictoBlox using which we can make it interact which our projects, and how to use it in both Stage and Upload modes by carrying out two activities – one for each mode.

Let’s begin with Dabble.

What is Dabble?

Dabble is a smart and versatile project making app that replaces a wide variety of electronic components and exploits the inbuilt features and sensors of your Smartphone like the GPS, mic, and accelerometer, thus transforming it into infinite virtual shields and more. Dabble works with widely used Bluetooth modules like the HC-05, HC-06, HM-10, and AT-09. 

Dabble is now available on both Playstore and Appstore.

Inside the Dabble Palette

Now, let’s take a look at the Dabble palette in PictoBlox.

  1. First, open PictoBlox.
  2.  Then, connect evive to your computer via a USB cable.
  3.  Next, click on the Board button in the toolbar and select its name from the drop-down menu.Choose board
  4. Next, click on the Connect button and select the appropriate serial port.
  5.  Now, connect the HC-05 Bluetooth module to evive by placing it in the headers provided.
    evive Alert
    Make sure that the RX pin of the Bluetooth module is connected to the TX3V3 pin on evive. As soon as you connect it, a red LED will start blinking on the module.  
  6. It will let us control our board using our Smartphone via Bluetooth.Aunty: Android devices can be paired with HC-05, HC-06, HM-10, and AT09. but iOS devices can only work with HM10.
  7. Now, open the Dabble palette. You’ll find dedicated blocks for each of Dabble’s modules.

Dabble in Stage Mode

Let’s first create a script for controlling Tobi’s movements using Dabble’s Gamepad module in the Stage Mode.

  1. For that, the first step is to upload the firmware to evive. Therefore, click on the Upload firmware button. Once the upload is complete, evive’s logo will appear on its screen. UploadFirmware
  2. Now, let’s continue with the script.
  3. Tobi should move right upon pressing right on the gamepad and left on pressing left.
  4. First, let’s add blocks for making Tobi move right. Drag and drop an if block into the scripting area to check if the right has been pressed.
  5. Then, drag and drop the is pressed on gamepad? block inside the hexagonal space of the if block and select right from the drop-down menu.is pressed on gamepad
  6. Next, drag and drop move steps block below the if arm and write 10 in the space given.move () steps
  7. Now, duplicate the entire set of blocks and stack them together.
  8. Then, select left from the drop-down menu of the second gamepad block and enter -10 in the second move steps block. This will make Tobi move left whenever left is pressed on the gamepad.
  9. Add a forever block for running the script continuously.
  10. Since we’re working in the stage mode, we’re going to use the when flag clicked hat block.
  11. With this, our script is complete! Dabble in Stage Mode

Pairing Dabble with evive

Now, let’s pair Dabble with evive. 

  1. Open the app. The first few screens give a brief about how you can work with Dabble.
  2. Next, click on the connect icon.
  3.  A dialogue box will appear on the screen asking for permission to turn on Bluetooth. Click on ‘Allow’.
  4.  Once you do so, a list of nearby devices will appear. Select your device’s name. Passwords for pairing with the device in your Smartphone’s Bluetooth setting:
    For HC-05: 000 0 or 1234 & for HM-10: 000000 or 123456
    Dabble how to Connect
  5. Once your Smartphone is paired with evive, open the Gamepad Module and you are ready to go!
  6. Maximize the stage and then click on the green flag to run the script!Dabble in Stage Mode

You can make fun games and animations like this space battle and play them in the Stage mode using Dabble.

Dabble in  Upload Mode

Now, let’s create a script in the Upload mode for controlling a DC motor connected to evive by sending the command to evive via Dabble’s Terminal module.

  1. Switch to the Upload by toggling the Mode button present right above the Stage.Upload Code Button
  2. You’ll observe that the stage is replaced by the editor window.Upload Mode
  3. We’re going to send textual commands to evive using Dabble’s Terminal module to control the motor. Attach a wheel to the motor shaft and connect the assembly to evive’s Motor Channel M1.DC Motor Control Fritzing Cirrcuit Diagram DC-motor-and-wheel ATL
  4. Now, let’s move on to the script.
  5. First, we’re going to check if the command given at the terminal is for starting the motor. So, drag and drop an if block into the scripting area.
  6. Then, drag and drop the is data from terminal block inside the hexagonal space of the if block and write ‘start’ in the white space.is data from terminal
    evive Notes Icon
    This block is case sensitive. Make sure that the text written in this block is EXACTLY the same as the command who type in Dabble’s Terminal module.
  7. Next, drag and drop the run motor () in direction () with speed () block. Select the channel to which the motor is connected from the first drop-down, the direction in which you want to rotate in the second, and the percentage speed at which you want the motor to rotate from the third.
  8. Now, duplicate the entire set of blocks for stopping the motor and stack them together.run motor block
  9. Then, write ‘stop’ in the second is data from terminal block and remove the run motor block.
  10. In place of it, drag and drop the free block and select lock from the first drop-down and the channel i.e. 1 from the second drop-down.
  11. Add a forever block to the script for running it continuously.
  12. Finally, drag and drop the when evive starts up hat block.
  13. With this, our script is complete!Dabble in Upload Mode
  14. Now, let’s upload it to evive by clicking on the Upload Code button.
  15. Once the upload is complete, disconnect evive from the computer.
  16. Now, open Dabble and click on the connect button. Once paired with evive, open the terminal module.

Now, type ‘start’. In doing so, the motor will start rotating. And on typing stop, it will stop. You can also use voice commands for controlling the motor.Dabble in Upload Mode

Conclusion

In this tutorial, we learned how to control actuators or send commands to them wirelessly via a Smartphone using Dabble.

Hope you had fun! Happy tinkering! 🙂

Share this Tutorial
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Related Projects & Tutorials
evive-Plug-and-Play-Part-1
evive – Plug and Play: Part 1
In this tutorial, we are going to give you a hands-on experience of evive’s plug and play interface through activities for controlling a DC motor, a servo motor, understanding the inbuilt touch sensors of evive.
PictoBlox – Stage Mode
In this tutorial, you learned about PictoBlox's Stage mode and how to control hardware in real-time using a USB cable or over Bluetooth. 
PictoBlox-Upload-Mode
PictoBlox – Upload Mode
In this tutorial, you'll see what is PictoBlox's Upload mode and how to use it to control our hardware wirelessly, i.e. without being connected to computer.
All articles loaded
No more articles to load
Featured Projects
All articles loaded
No more articles to load

Leave a Reply

Close Menu
×

Cart