.
Introduction.
This is by no mean a complete project. This is my learning experience about using the ModusToolbox and Picovoice platform to build some sample applications. In this write-up, I am using these two pieces of hardware; PSoC™ 6 62S2 Wi-Fi BT Pioneer Kit & IoT Sense Expansion Kit.
.
Read the Quick Start Guide and ensure the jumper J14 is at position 2-3 to select 3.3V. The XRES switch (SW1) is for resetting teh device.
.
.
.
Setup ModusToolbox.
Follow the instructions detailed in the ModusToolbox Software page to download and install the software. The instructions are clear and easy to follow.
.
Test sample app with ModusToolbox and Picovoice.
Here I am going to build the Picovoice sample voice app which comes with the ModusToolbox voice template. I am using the Eclipse IDE for ModusToolbox to create the project.
After launching the IDE, open the Project Create and select the BSP: CY8CKIT-062S2-43012 as the MCU board.
.
.
Next select the Picovoice Voice Recognition Demo template.
.
.
Then click Create. It will take some time to create the app.
Before you can program the board, you need to retrieve the Access Key from the Picovoice console. After registering at Picovoice website, login and copy the Access Key.
.
.
Then paste it at the main.c
:
.
.
Before programming the board, open Device Manager (I am using Windows) to find out the COM port and connect a terminal (putty) to the board.
.
.
.
After programming the board, you can test the voice app and view the response at the terminal view:
.
.
.
Test sample app with ModusToolbox and OLED Display Module.
I followed these steps to create an app which displays messages on the OLED display. For other details about the display, check out this link.
- Create an empty application with Eclipse IDE
- Add OLDE Display (SSD1306) library to the application
- Add emWin library to the application
- Enable EMWIN_NOSNTS emWin library option by adding it to the Makefile COMPONENTS list:
COMPONENTS+=EMWIN_NOSNTS
.
.
.
- Place the following code in the
main.c
file:
#include "cybsp.h"
#include "mtb_ssd1306.h"
#include "GUI.h"
int main(void)
{
cy_rslt_t result;
cyhal_i2c_t i2c_obj;
/* Initialize the device and board peripherals */
result = cybsp_init();
CY_ASSERT(result == CY_RSLT_SUCCESS);
/* Initialize the I2C to use with the OLED display */
result = cyhal_i2c_init(&i2c_obj, CYBSP_I2C_SDA, CYBSP_I2C_SCL, NULL);
CY_ASSERT(result == CY_RSLT_SUCCESS);
/* Initialize the OLED display */
result = mtb_ssd1306_init_i2c(&i2c_obj);
CY_ASSERT(result == CY_RSLT_SUCCESS);
__enable_irq();
GUI_Init();
GUI_DispString("Hello world!");
for(;;)
{
}
}
.
- Build the application and program the board.
.
.
Summary.
In this post, I have shown how to create a sample Picovoice app and another simple app displaying text on the OLED display. For additional details about Picovoice and the OLED display, you can refer to the following resources:
In next post, I will customise the Picovoice app with new intents and use the OLED display as an output.
.
Comments
Please log in or sign up to comment.