Android, Bluetooth and MIAC



Similar documents
PID Control. Proportional Integral Derivative (PID) Control. Matrix Multimedia 2011 MX009 - PID Control. by Ben Rowland, April 2011

FlowKit in-circuit debug system

E-Blocks Easy Internet Bundle

How to Create an Android Application using Eclipse on Windows 7

FFT Frequency Detection on the dspic

ECIO40P ECIO28P ECRM40. Page 1. USB programmable microcontrollers. 0.6 DIP footprint. Supplied with a free version of Flowcode. E-blocks compatible

Solar Energy Conversion using MIAC. by Tharowat Mohamed Ali, May 2011

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Board also Supports MicroBridge

Example Connection between USB Host and Android

E-Blocks Easy RFID Bundle

Workshop on Android and Applications Development

Android Programming. Høgskolen i Telemark Telemark University College. Cuong Nguyen,

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

LED board datasheet EB

Fahim Uddin 1. Java SDK

How To Develop An Android App On An Android Device

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

RS232 Board datasheet

CAN bus board. EB018

About this Release. Introduction. Prerequisites. Installation. Using the Web SDK Packager

IOIO for Android Beginners Guide Introduction

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Android Programming and Security

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

Running a Program on an AVD

Android Setup Phase 2

How to develop your own app

COPYRIGHT RESERVED TEAM MYSTERIOUS MANIACS HOME AUTOMATION via BLUETOOTH (Using ANDROID PLATFORM)

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

Friendly ARM MINI2440 & Dalvik Virtual Machine with Android

OpenCV on Android Platforms

Setting up Sudoku example on Android Studio

An Introduction to Android

How To Develop Android On Your Computer Or Tablet Or Phone

Switch board datasheet EB

Jordan Jozwiak November 13, 2011

Android Environment SDK

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Application Development Setup Guide

Tutorial on Basic Android Setup

Advantages. manage port forwarding, set breakpoints, and view thread and process information directly

ANDROID LEVERED DATA MONITORING ROBOT

Developing NFC Applications on the Android Platform. The Definitive Resource

J A D E T U TO R I A L

Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade!

Android: Setup Hello, World: Android Edition. due by noon ET on Wed 2/22. Ingredients.

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

Arduino & Android. A How to on interfacing these two devices. Bryant Tram

Introduction to Android. CSG250 Wireless Networks Fall, 2008

Installing the Android SDK

Introduction to Android Development

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

Course Project Documentation

directory to "d:\myproject\android". Hereafter, I shall denote the android installed directory as

Android Application Development and Bluetooth Technology

Android Environment SDK

Open Source Telemedicine Android Client Development Introduction

Basic Android Setup Windows Version

Computer Automation Techniques. Arthur Carroll

How to Set Up Your PC for Android Application Development

Lab 0 (Setting up your Development Environment) Week 1

New Technology Introduction: Android Studio with PushBot

Android Tutorial. Larry Walters OOSE Fall 2011

With a single download, the ADT Bundle includes everything you need to begin developing apps:

Android Application Development: Hands- On. Dr. Jogesh K. Muppala

Chapter 2 Getting Started

How to Set Up Your PC for Android Application Development

Mobile Application Development

Hello World. by Elliot Khazon

RN-131-PICTAIL & RN-171-PICTAIL Web-Server Demo Application

BLE113 DEVELOPMENT KIT

Smartphone market share

Android based Secured Vehicle Key Finder System

CS 528 Mobile and Ubiquitous Computing Lecture 2: Android Introduction and Setup. Emmanuel Agu

Waspmote. Quickstart Guide

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Android Development. Marc Mc Loughlin

STLinux Software development environment

RN-131-PICTAIL & RN-171-PICTAIL Evaluation Boards

ID TECH UniMag Android SDK User Manual

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

Freescale Semiconductor, I

How to build your first Android Application in Windows

Developing Android Apps: Part 1

Android Programming: Installation, Setup, and Getting Started

Android Mobile App Building Tutorial

HTTPS hg clone plugin library SSH hg clone plugin library

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

Android Development. 吳 俊 興 國 立 高 雄 大 學 資 訊 工 程 學 系

Tutorial: Android Object API Application Development. SAP Mobile Platform 2.3 SP02

Android Development Setup [Revision Date: 02/16/11]

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

App Development for Smart Devices. Lec #2: Android Tools, Building Applications, and Activities

Transcription:

Android, Bluetooth and MIAC by Ben Rowland, June 2012 Abstract Discover how easy it is to use TCP network communications to link together high level systems. This article demonstrates techniques to pass data between embedded devices such as Microcontrollers, Computers, Raspberry Pi and Android. Requirements Software: Professional or Educational version of Flowcode V4 / V5 Python 2.7 Android JAVA SDK with Eclipse Hardware: E-blocks setup with EB023 Ethernet board Raspberry Pi with EB080 E-blocks adapter board Android Phone or Tablet Computer The Flowcode Program This demonstration application highlights a way to externally control the MIAC operation using a remote device such as an Android phone or tablet. The setup consists of a MIAC System, comprising a Master MIAC and a Bluetooth Expansion Module. The Bluetooth module is then used as a data link between the MIAC and the controlling device. The Master MIAC is also used to setup the Bluetooth module ready for data pairing and then sit and wait for commands coming in via the Bluetooth. When data is received from the Bluetooth module the Master MIAC processes the incoming data and allows things like the relays to be switched on or off. Page 1

The main part of the program begins by setting up the initialization of the Bluetooth module and other components such as the MIAC LCD. A series of AT commands are then send to the Bluetooth module which do a number of things. The send_bt_command macro is then used to transmit the command string to the Bluetooth module, collect the automatic echo and then collect the module s response. AT&F* ATS512=4 - ATS0=-1 AT+BTK="1234" AT&w ATZ Factory Reset All Settings Not Sure Not Sure Setup Pair Key Write To Non-Volatile Memory Module Software Reset The main program then loops waiting for a data byte to be received from the Bluetooth module. If the ASCII character a is received then relay Q1 will be switched on whereas if character b is received then relay Q1 will be switched off. The MIAC will also reply to the Android device to confirm that the state of relay Q1 has changed. This can then be adapted to create complex routines on the MIAC from a single data command byte or can be expanded to control other MIAC Add-on modules such as RS232 or PWM motor control. Page 2

The Android App To begin developing on a system such as Android first you need to download and install the SDK or software developers kit. For Android there are guides available on what to download and then how to plug it all together within the Eclipse environment. Official Getting Started Tutorial - http://developer.android.com/sdk/installing.html Once you have everything installed you should have all of the following tools required to develop android applications. Eclipse IDE (Integrated Development Environment) Eclipse ADT Plugin (Android Development Tools) Android SDK Android ADB (Android Debug Bridge) Android Emulator (PC / MAC / Linux Virtual Android Device) Page 3

The Eclipse environment is used to edit the various code files in the android project. The ADT plugin is used like a wrapper to convert Eclipse into an Android development environment with all the android related functionality. The SDK is the compiler version responsible for deciding which version of Android you are compiling for and are compatible with. The ADB is used to debug and test your applications directly on your android device and finally the Emulator allows you to debug and test via a virtual Android. Note that the virtual Android does not currently support Bluetooth functionality but things like TCP style communications are supported. It is also recommended to go through some of the demo applications provided such as the Hello World demo to allow you to get used to the IDE and various Android tools. There are generally only five basic files you need to be aware of when working on a basic android project. The Java source file Located in the src folder and used to control the app s activity The main.xml file Located in the res folder and used to control the app s layout The strings.xml file located in the res folder and used to store all the dynamic string data The AndroidManifest.xml file Located in the root folder and used to control app permissions such as Bluetooth/Wifi access. The Android App file Located in the bin folder and used to install the app onto a Android device. In the example Android App we have created two buttons to allow the ASCII characters a and b to be sent to the MIAC system to control relay Q1. There is also a third button and a text input field which allows for other messages to be sent to the MIAC system for development purposes. Any data send between the MIAC system and the Android app is shown in a non-editable text field. Fig4 Android IDE and Layout file Main.xml Page 4

Further reading Below are some links to other resources and articles on related subjects, and technical documentation relating to the hardware used for this project... Flowcode: MIAC : Android: Learning Centre: User Forums: Product Support: http://www.matrixmultimedia.com/flowcode.php http://www.matrixmultimedia.com/miac.php http://developer.android.com/sdk/installing.html http://www.matrixmultimedia.com/lc_index.php http://www.matrixmultimedia.com/mmforums http://www.matrixmultimedia.com/sup_menu.php Copyright Matrix Multimedia Limited 2011 Flowcode, E-blocks, ECIO, MIAC and Locktronics are trademarks of Matrix Multimedia Limited. PIC and PICmicro are registered trademarks of Arizona Microchip Inc. AVR, ATMega and ATTiny are registered trademarks of the ATMEL corporation. ARM is a registered trademark of ARM Ltd. Page 5