Table Of ContentTable of Contents
Introduction
What is MIT App Inventor? Arduino (From Arduino Website)
Turn On and OFF an LED (Hello World) Creating Android
App
Connecting Bluetooth and programming Arduino Control LED by Speech
recognition
Task
Control a Servo Motor
Arduino code for servo control Control Multiple Servo Motors
Arduino Code Multiple servo RGB Color
Slider
Activity starter
Complete program for the RGB Slider Arduino Program for RGB Slider
Common anode Arduino program Common Cathode Arduino program
RGB Color Picker
Arduino Program
Temperature data into Android Arduino Program for Temperature
Android Remote control Robot Arduino Program for Android remote
Control the same robot by speech recognition How to import aia files to
MIT app inventor Contact and app inventor files.
Introduction
What is MIT App Inventor?
MIT App Inventor is an innovative beginner’s introduction to programming and
app creation that transforms the complex language of text-based coding into
visual, drag-and-drop building blocks. The simple graphical interface grants
even an inexperienced novice the ability to create a basic, fully functional app
within an hour or less.
Arduino (From Arduino Website)
Arduino is an open-source prototyping platform based on easy-to-use hardware
and software. Arduino boards are able to read inputs - light on a sensor, a finger
on a button, or a Twitter message - and turn it into an output - activating a motor,
turning on an LED, publishing something online. You can tell your board what
to do by sending a set of instructions to the microcontroller on the board. To do
so you use the Arduino programming language (based onWiring), and the
Arduino Software (IDE),based on Processing.
Over the years Arduino has been the brain of thousands of projects, from
everyday objects to complex scientific instruments. A worldwide community of
makers - students, hobbyists, artists, programmers, and professionals - has
gathered around this open-source platform, their contributions have added up to
an incredible amount of accessible knowledge that can be of great help to
novices and experts alike.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and
programming. As soon as it reached a wider community, the Arduino board
started changing to adapt to new needs and challenges, differentiating its offer
from simple 8-bit boards to products for IoT applications, wearable, 3D
printing, and embedded environments. All Arduino boards are completely open-
source, empowering users to build them independently and eventually adapt
them to their particular needs. The software, too, is open-source, and it is
growing through the contributions of users worldwide.
Turn On and OFF an LED (Hello World)
Before starting to go inside this chapter, firstly you need to install Arduino Ide
from the website arduio.cc Download the latest Arduino software and install it
on your laptop or PC, without Arduino IDE you cannot program your Arduino
board.
Things you need for this tutorial are 1) Arduino board 2) LED and Android
phone to control the LED connected to Arduino.
First we create android app to control the LED, to do this you should have a
Gmail account or you can create a new account it’s really easy and most of
people will have an existing Gmail account.
The following step-by-step picture tutorial will guide you to create your first
android app that connects to your Arduino.
1) Go to the website http://ai2.appinventor.mit.edu , when you enter for
the first time you will be required to login with your Gmail id and
password.
2) MIT appinventor will ask to use your Gmail account click allow and
check remember this approval for the next 30 days.
3) When you logged into MIT app inventor development environment for
the first time, there won’t be any projects, you will be greeted with an
empty window. Click on the start new project to create your first android
app.
4) Name your new project as LED_CTRL or whatever name you would like for
your first app and click ok to enter into the main screen.
5) When you click ok after naming your app, you will be moved to a main
screen to make your app, the screen that appears on your window is called as
Designer, where you need to design user interface like buttons, widget, text
pane, label this window act as a controller and there is also another window
where you need to program the graphical codes to make your function to work.
On the left side you can see palette, the palette which contains interface, layout,
Media, Drawing and Animation, Sensors, Social, Connectivity etc., To create
your user interface on the main screen you need to pick buttons and your
required stuffs from the palette.
Click Layout on the left side below palette, Pick Table Arrangement and drop
into the Viewer.
On the left side of the table properties, change columns and rows to 3 and
also change the width to fill parent from automatic.