Introduction
In this activity, we will control the Mecanum Pick and Place according to our needs using the Dabble application on our own Devices.
We will first understand how to operate Dabble and how to modify our code according to the requirements. The following image is the front page of the Dabble Application.
Select the Gamepad option from the Home Screen and we will then use the same gamepad to control our Mecanum Pick and Place.
Code
The following blocks represent the different functions that are created to control the Mecanum Pick and Place for different types of motions. We will use the arrow buttons to control the basic movements.( Forward, Backward, Lateral Left, Lateral Right ). We will use custom functions to control the Pick and place actions. We will use the Triangle button to initiate the Pick action and the Circle button to initiate the place action. We will use the Cross button to rotate to the right direction and we will use the Square button to rotate to the left direction. We can use the Select button to stop the Mecanum whenever possible.
Note: You can always customize each and every function and button, and make your own activities easily. You will have to add the extensions of Mecanum and also of Dabble to access the functions. To access the basic extensions required, make sure to select the Board as Quarky first. Select the Python Coding Environment and on the top right click on the Upload Mode only for the code to work properly.
You will have to connect the Quarky with the Dabble Application on your device. Make sure Bluetooth is enabled on the device before connecting. Connect the Mecanum to the Dabble application after uploading the code. You will be able to connect by clicking on the plug option in the Dabble Application as seen below. Select that plug option and you will find your Quarky device. Connect by clicking on the respective Quarky.
Important Notes
- The code will only run by uploading the code by connecting the Mecanum with the help of a C-Type Cable to the Laptop.
- You will be able to upload the Python Code by selecting the Upload option beside the Stage option.
- There may be a case where you will have to upload the firmware first and then upload the code to the Mecanum. You will be able to upload the firmware in Quarky with the help of the following steps:
- Go to the Block Coding Environment and select the Quarky Palette from the Block Section.
- Select the Settings button on top of the palette.
- In the settings dialog box, scroll down, and select the Upload Firmware option. This will help you to reset the Quarky if any previous code was uploaded or not.
- After the Firmware is uploaded, you can shift to the Python Mode and upload the code you have written. The upload button can be seen to the right section of the terminal as shown below.
Output
Forward-Backward Motion:
Circular Right-Left Motion:
Lateral Right-Left Motion:
Pick and Place Mechanism with Dabble: