
Page 19
Copyright © 2017 Matrix Technology Solutions Limited
www.matrixtsl.com
Controlling the MIAC
Using App Inventor
MIAC AllCode
Instructional Guide
6. Click ‘Procedures’ from the ‘Built-in’ list and drag the “call WriteRelay” icon into the middle of
your “when R1On.Click” and “when R1Off.Click” icons. Add literal values
from ‘Math’ as the Channel and Value parameters to the WriteRelay code blocks.
Your two blocks should look something like this:
Repeat for the other switches.
7. Now you should build the project. Select “App (provide QR code for .apk)” from the
“Build’ menu. Once this is complete, run the “MIT AI2 Companion” app and then scan the
QR code into your Android device using the “Scan QR Code” button.
Note:
If you visit the App Inventor website you will find instructions about other methods that are
available for transferring your program to your Android device.
8. You can now run your program on your Android device. Click “Connect to device” and
select the MIAC AllCode from the list. Clicking the “Relay 1 On” button should make Relay Q1
switch on. Clicking the “Relay 1 Off” button should make Relay Q1 switch off.
You may have noticed a number of icons at the top of the screen in App Inventor. These
define the procedures for communicating with the MIAC AllCode and some standard functions to
allow the Bluetooth link to be set-up.
The tan coloured icons represent
events
such as when a button is clicked, when a timer
triggers or when an error occurs.
The mauve coloured icons relate to a set of
procedures
or
subroutines
that have been
designed to perform certain tasks for you. You should not alter these unless you are an
experienced App Inventor user.
Содержание MI3932 MIAC AllCode
Страница 1: ......