The connection details between Arduino and other components are shown in Table 2. Now, we need to connect the components and fit all the components and relay modules in a switch box or enclosure. 15: MIT App Inventor code blocks Connections Save the project as TouchSwitch.apk and install this. Pick and place the code blocks, as shown in Fig. Next, open the Blocks section in MIT App Inventor. Open the Designer section, create a layout for the app, and then add the following components-four buttons, a list picker, and a Bluetooth client, as shown in Fig. You will find two tabs-Designer and Blocks on the top right side of the screen. Next, open the link to start the MIT App Inventor project. First, you need to have a valid Google email account. Android app developmentĪpp development is done on the MIT App Inventor. Compile it and upload the code into the Arduino Uno board. We need to create another function to check the state of buttons and assign their tasks.įor example, if we touch a button, the assigned task changes the state of the relay to either on or off (refer Figs. 11: Creating display elements on the screen Then create a setup function where we will add codes to show buttons and all other elements on display (refer Figs. Next, add codes for colours that we are going to use in the display (refer Fig. 7: Initialising the required librariesĬreate a function to get the point of touch on the LCD screen in X and Y coordinates (Fig. In the first part of the code, initialise the required libraries, as shown in Fig. 6: Installing library for temperature sensor CodingĪfter installing the required libraries, let’s start Arduino coding. Here, we have used MCUFriend 6cm TFT LCD Library ST7789V. The libraries needed for this project are Adafruit GFX, TouchScreen, and NTC thermistor. Then search the library name and click on the install button. For this, go to the Sketch menu and click on Manage libraries option (Fig. 2: TFT display for Arduinoįirst of all, install the required libraries in Arduino IDE. TFT touch display shield (6cm) used in this project is shown in Fig. Now, let’s collect the components listed in Table 1 to start the project.
0 Comments
Leave a Reply. |