P R O T E U S: (1-Digit Up Counter)
P R O T E U S: (1-Digit Up Counter)
P R O T E U S: (1-Digit Up Counter)
P R O T E U S
WITH
M I T A P P
I N V E N T O R
(1-DIGIT UP COUNTER)
WHAT IS A MIT APP MIT APP EDITOR CREATING THE SIMULATING
INVENTOR? INTERFACE APP THE COUNTER
INTRODUCTION
MIT App Inventor is an online tool used in creating mobile apps that
applies "What You See is What You Get" (WYSIWYG) editor functionalities,
which cater to Android and iOS. In this web tool, we can design our app's
desired interface and program it using Block Programming, which is very
interesting and helpful to beginners in programming.
While we create and edit our app on our
computer, we can simultaneously see and
check our ongoing project on our smartphone
through the MIT AI2 Companion App.
Figure 2: MIT AI2 Companion App Logo.
The MIT App Inventor's main interface offers two primary editors:
The Design Editor and the Block Editor.
To start creating an app in MIT App inventor, we must first follow these steps:
STEP 1
STEP 2
STEP 4
Before accessing the website, you will need to sign in to your Google Account.
STEP 5
STEP 6
STEP 1
STEP 2
Add Bluetooth Module and Arduino in the Proteus Circuit. These two
modules would serve as the gateway for command of our Up Counter circuit.
• Remove the Push Button on our Proteus circuit.
• Select and Add the Bluetooth HC-05 Module and Arduino.
• Connect the TXD and RXD pins of the Bluetooth Module to pins 0
and 1 of the Arduino, respectively.
• Connect Pin 14 of the Decade Counter to one of the pins in
Arduino. You can select from pin 2 to pin 7. In this demo, we will
use Pin 6.
•
STEP 3
On the Design Editor, click the "Screen" in the components section. Then,
edit the layout of the screen using the properties listed in the Properties
section. Select also the size of the device.
STEP 5
Enter the app label by clicking the option Label in the Palette section,
located in the User Interface Tab. Drag it on the Viewer section, and then
edit the app label using the Properties section. You can edit font size, font
style, color, and alignment in the Properties section.
STEP 6
Add List Picker in the Viewer section. This List Picker will
display the available Bluetooth Devices for the app. Drag it on
the Viewer section, then edit it on the Properties section. Then,
write "Select Bluetooth Connection" as the label.
STEP 7
Add a button in the Viewer section. This button will serve as the
disconnection button once we connect to a Bluetooth device. Edit it on the
Properties section, and label it Disconnect. Since this button must only
show up once the device is connected, we must not make it visible.
Uncheck the Visible checkbox in the Properties section.
STEP 8
Add another button in the Viewer section. This button would serve as
the manual trigger button that would make the counter count up. Edit its
properties in the Properties section, and label it Count Up.
STEP 4
Click ListPicker1, then this time, click When ListPicker1.After Picking block.
Drag it in the Viewer. Then click the ListPicker1, click set ListPicker1.Selection
to block, connect it to the When ListPicker1.After Picking block. After that, click
the Bluetooth client, then select call BluetoothClient.Connect/Address and
connect it to the set ListPicker1.Selection to clock. Click ListPicker1, then select
ListPicker1.Selection" and connect it to call BluetoothClient. Connect/Address
block. These blocks would allow the app to pick and call the Bluetooth module
of the Proteus circuit.
STEP 5
Once the app connects to a device, we must make the Disconnect button
or Button 1 visible. This mechanism would allow the app user to disconnect the
device once they finished simulating the Proteus circuit. Click the Logic button
in the Blocks section, and then select the if/then block. Place it before the call
BluetoothClient. Connect/Address block. This block must be connected beside
the "if" part. Then, click Button 1, then select "set Button1.Visible to", then
attach it beside the "then" part of the "if/then" block. Click the Logic in Blocks
section, select True, then connect it beside the set Button1.Visible to block.
STEP 6
Button 2 is the Count Up button. This button is responsible for sending the
command signal for the Proteus circuit. For every click on this button, the
Proteus counter would count up. We need to program this button to send signal
on our Proteus circuit. Click Button 2, then select when Button1.Click / do block.
Then go to Bluetooth Client, then select call BluetoothClient1.SendText, then
attach a Text block, then write "1" on that block. This block would allow every
click of the Count Up button to send the command "1" to the Proteus circuit.
DOWNLOADING THE APP
The Bluetooth HC-05 Module in the Proteus circuit will receive the
signal of command from the app that we have created, and the Arduino
module would be the one to interpret this signal. We need to program the
Arduino for the Proteus circuit to count up when we use the app.
STEP 1
STEP 2
Program the void loop. Set if statements. Set the string command
equals to Serial.read(), which is the received message from the
Bluetooth module. In our app, if we click Count Up, the app will send
the text 1. We need to program the Arduino with the instruction that
for every command received, pin 6 of Arduino would be HIGH then
would be LOW again, thus creating a signal pulse. To accomplish this,
we will set an if statement indicating that the Pin 6 would be HIGH,
then would be LOW after several milliseconds.
STEP 4
Click Verify to check if there is an error in the code. Then click the
Sketch on the Menu bar, then click Export Compiled Library. Open the
Sketch Folder to check the location of the sketch file, which should be
in .hex or .ino format.
STEP 5
After coding, we will now upload our code. First, open your Proteus
circuit, then double-click the Arduino module. Click the folder icon
beside the Program File box. Find the location of the .hex or .ino file of
your Arduino code. Click the file and then click Open, and then OK.
SIMULATING THE CIRCUIT
USING MIT APP INVENTOR
STEP 2
STEP 4
Once connected, we can now test the app. If you press the Count
Up button, the counter in the Proteus would count up from 0 to 9 and
would go back again to 0 after 9. The speed of counting depends on
the speed of pressing the Count Up button.
POP-UP QUIZ
Multiple Choices
1.) It is a web tool where we can design easy to create apps and applies "What You See is What You
Get" (WYSIWYG) editor functionalities.
a. TinkerCAD c. Visual Studio
b. Adobe Photoshop d. MIT App Inventor
2.) What type of programming is used by MIT App Inventor?
a. Ladder Programming c. Block Programming
b. Stair Programming d. Pool Programming
3.) What app allows us to download our created app in MIT App Inventor?
a. Proteus c. Arduino IDE
b. MIT AI2 Companion d. Google Music
4.) A component module designed and widely used for wireless serial communications.
a. Bluetooth c. Decade Counter
b. Arduino d. 7-Segment Display
5.) An interface of MIT App Inventor used in editing the app's user interface?
a. Block Editor c. Arduino Editor
b. Design Editor d. Media Editor
Answer Key
1. D
2. C
3. B
4. A
5. B
UNIT D 2467 URDANETA RD, MAKATI, METRO
MANILA, PHILIPPINES
[email protected]
+(02)8370 1811
www.facebook.com/erovoutika