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
Configure Wifi Module and Establish Android Communication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 | |
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:
Publicar un comentario