martes, 12 de febrero de 2013

Arduino Mega ADK - Fundamentals


Requirements

Hardware
     1. Arduino Mega ADK
     2. Wifi-shield
     3. Mega Sensor shield
     4. Wifi Module

Tinker-kit also comes with several micro mechanical sensors such as accelerometer, photo-resistor, among others. Each sensor can be connected to the Mega sensor shield in order to sense environmental data.

Software

HTerm (for configuring Arduino WiFi)
Eclipse ( IDE for Android application development)

Assemble the follow structure (from top to bottom)
Wifi-Module -> Wifi-shield -> Micro controller


Configure Wifi Module and Establish Android Communication

/*
* author Huber Flores
*/
### Getting Arduino ready for HTerm
# 1- Set your Wifi Shield to USB (It’s a small switch on you WiFi Shield).
# 2- Upload BareMinimum sketch to your Arduino ((File->Examples->Basic->BareMinimum).
# 3- Open HTerm.
### Connect with following settings
# Port = Port, that you arduino is connected to
# Baud = 9600
# Data = 8
# Stop = 1
# Parity = None
# CTS Flow control = unchecked
### Set up new Baud rate, by typing in the following into Input control box
$ $$$ (Send or enter = None)
$ set u b 115200 (Send or enter = CF-LF from now on)
$ save
$ reboot
###Connecting Arduino to WiFi
# Connect as you did before, only set Baud to 115200
# Enter command mode(type $$$ (send on enter = None))
$ Set “Send or enter” to CF-LF
# Type “scan” (you should now see a list of WiFi networks available)
$ set wlan ssid <your wifi name>
$ set wlan pass <your wifi password>
$ save
$ reboot
# if configuration is successful then, Wifi Shield and led from Wifi module must be blinking
### Set up Arduino to communicate with Android
# Enter command mode
$ set ip remote 2000
$ set ip proto 1
$ comm times 1000
$ get ip
$ set ip host <your android ip address>
$ save
$ reboot
view raw arduino.as hosted with ❤ by GitHub


Once you established communication with Android, then you are ready to start developing Arduino sketches and your Android app.

Here some code to try

No hay comentarios: