Skip to main content

Seeeduino ADK Main Board

enter image description here

La plataforma Android 3.1 (también retroportada a Android 2.3.4) introduce el soporte para Android Open Accessory, que permite que el hardware USB externo (un accesorio USB de Android) interactúe con un dispositivo con Android en un modo especial de "accesorio". Basado en el diseño de referencia ADK de Google, fusionamos las ventajas de Seeeduino en nuestra Seeeduino ADK Main Board.

Ahora conecta la Seeeduino ADK Main Board a tu dispositivo móvil Android y comienza a desarrollar tu accesorio personalizado.

SKU:ARD52028P

Especificaciones

  • Compatible con Android Open Accessories development Kit (ADK) (Android v2.3.4 y superior)

  • Funciona con Android Debug Bridge (ADB) usando MicroBridge (Android v1.5 y superior)

  • Simplemente funciona como un Arduino Mega con un USB Shield integrado

  • Voltaje de operación: 5v/3v3

  • Voltaje de entrada: 6V - 18V

  • E/S digital: 50

  • Entradas analógicas: 16

  • Salidas PWM: 14

  • Puertos serie por hardware (UART): 4

  • I2C: 1

  • SPI por hardware (hasta 8Mbps): 1

  • Host USB integrado (MAX3421)

  • Esclavo USB integrado (FT232RL)

  • Regulador de potencia LDO de 3.3V-500mA incorporado.

Interfaz

enter image description here Características Destacadas de Seeeduino ADK

Los bloques de hardware de Seeeduino ADK se listan a continuación: A: Conector Micro USB, conecta la placa principal a la PC. Se usa para cargar el sketch usando Arduino IDE. B: Interruptor deslizante, para elegir el voltaje de operación o E/S: 3.3V o 5V C: Conector USB A, conecta al dispositivo móvil Android. D: Conector JST / Jack DC, para fuente de alimentación DC externa. No conectar la PC mientras se usa DC externo. E: Botón de Reset, convenientemente ubicado en el lateral para permitir usar reset mientras se usan shields. F: Pines de E/S G: ICSP, para programar el Bootloader de Arduino usando AVR ICSP H: pines de conexión del Max3421E GPIO I: pines de conexión del FT232RL

Demostración

La siguiente imagen ilustra un ejemplo de aplicación de la Seeeduino ADK Main Board con un móvil Android. Ejecuta la aplicación demo basada en MicroBridge proporcionada e ilustrada en esta página. Todos los componentes electrónicos básicos se toman del Arduino Sidekick Basic Kit .

enter image description here Conexión de Seeeduino ADK Main Board y Móvil Android

enter image description here

  • Cargando Firmware

  • Configura el interruptor deslizante VCC a 5V.

  • Conecta la Seeeduino ADK Main Board - Micro USB al puerto USB de la PC.

  • Configura el tipo de placa en Arduino IDE a Arduino Mega 2560.

  • Compila el Sketch Demo y cárgalo a la placa principal.

  • Aplicación Android

  • Instala el software de desarrollo de la plataforma Android.

  • Importa la aplicación demo de Android al espacio de trabajo de Eclipse.

  • Conecta el dispositivo móvil a la PC y carga la aplicación

  • Conecta el móvil a la ADK Main Board.

  • Habilita ADB en tu dispositivo móvil si no está ya habilitado. Esto es solo para MicroBridge.

  • Presiona el botón Reset.

Usando MicroBridge

Las aplicaciones de muestra y la biblioteca están disponibles en la sección de recursos. El siguiente Sketch de Arduino y código Android están bien comentados explicando el uso.

  • SeeeduinoADKDemo.pde
//Seeeduino ADK Demo using Niels Brouwers' MicroBridge library.
//Connect a LED to D12 and a variable resistor(POT) to A0

#include <SPI.h>
#include <Adb.h>

// Adb connection.
Connection * connection;

// Elapsed time for ADC sampling. The rate at which ADC value is sent to Android device.
long lastTime;

//State of LED. Initially OFF.
uint8_t LEDState=0;

// Event handler for the shell connection.
// This event handler is called whenever data is sent from Android Device to Seeeduino ADK.
// Any data / command to be sent to I/O of ADK has to be handled here.
//
// For eg: 1.Controlling an ouput port 2.Interacting with a device connected
// to ADK via IIC or Serial Port.

void adbEventHandler(Connection * connection, adb_eventType event, uint16_t length, uint8_t * data)
{

// In this example Data packets contain one byte and it decides the state of a LED connected to D12
// The size of data is predetermined for this application. Android device also uses the same size.

if (event == ADB_CONNECTION_RECEIVE)
{
if(LEDState != data[0])
{
digitalWrite(12, data[0]); // Change the state of LED
Serial.println(data[0],DEC);
LEDState = data[0]; // Store the State of LED
}
}

}

void setup()
{
//Serial port debug purpose
Serial.begin(57600);

// Note start time
lastTime = millis();

// Set Digital pin 12 (LED is connected) as output
pinMode(12,OUTPUT);

// Initialise the ADB subsystem.
ADB::init();

// Open an ADB stream to the phone's shell. Auto-reconnect. Use any unused port number eg:4568
connection = ADB::addConnection("tcp:4568", true, adbEventHandler);

}

void loop()
{
//Check if ADC needs to be sampled.
if ((millis() - lastTime) > 20)
{
//Read ADC value
uint16_t data = analogRead(A0);

//Send the ADC value to Android device as two bytes of data.
connection->write(2,(uint8_t*)&data);
lastTime = millis();
}

// Poll the ADB subsystem.
ADB::poll();
}
/* Application demonstrates the interaction between Seeeduino ADK and Android Device
* using Niels Brouwers' MicroBridge library.
*
* Android Device: Any device with Android v1.5 which supports ADB(Android Debug Bridge).
*
* This application uses a very simple (or a trivial) design to make it understandable.
*
* Overview:
* 1.Seeeduino ADK Main Board periodically samples Analog Channel 0 and sends it
* to Android Device for display. This value is displayed using a TextView and SeekBar Widgets
*
* 2.Android device controls the state of a LED connected to Digital Pin 12 of ADK Main Board.
* A Button Widget used for this.
*
* Microbridge uses ADB based client-server implementation. The Server code that runs on Android
* device runs in a separate thread. Hence any update to UI widgets value has to be carried out
* in UI thread. This application uses XML based UI creation as it is easier for adding addition
* UI Widgets.
*
*/
package com.seeedstudio.SeeeduinoADKDemo;

import java.io.IOException;

import org.microbridge.server.AbstractServerListener;
import org.microbridge.server.Server;

import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Button;


public class SeeeduinoADKDemo extends Activity implements OnClickListener {
private int adcSensorValue=10;

//UI Widgets
TextView tvAdcvalue;
SeekBar sbAdcValue;
Button bOutPutLED;

boolean LEDState = false ; //initially OFF

// Create TCP server (based on MicroBridge LightWeight Server).
// Note: This Server runs in a separate thread.
Server server = null;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);

bOutPutLED = (Button) findViewById(R.id.buttonOuputLED);
bOutPutLED.setOnClickListener(this);


// Create TCP server (based on MicroBridge LightWeight Server)
try
{
server = new Server(4568); //Use the same port number used in ADK Main Board firmware
server.start();
} catch (IOException e)
{
Log.e("Seeeduino ADK", "Unable to start TCP server", e);
System.exit(-1);
}

server.addListener(new AbstractServerListener() {

@Override
public void onReceive(org.microbridge.server.Client client, byte[] data)
{

if (data.length<2) return;
adcSensorValue = (data[0] & 0xff) | ((data[1] & 0xff) << 8);

//Any update to UI can not be carried out in a non UI thread like the one used
//for Server. Hence runOnUIThread is used.
runOnUiThread(new Runnable() {
@Override
public void run() {
new UpdateData().execute(adcSensorValue);

}
});

}

});

} //End of TCP Server code

// UpdateData Asynchronously sends the value received from ADK Main Board.
// This is triggered by onReceive()
class UpdateData extends AsyncTask<Integer, Integer, String> {
// Called to initiate the background activity
@Override
protected String doInBackground(Integer... sensorValue) {

//Init SeeekBar Widget to display ADC sensor value in SeekBar
//Max value of SeekBar is set to 1024
SeekBar sbAdcValue = (SeekBar) findViewById(R.id.sbADCValue);
sbAdcValue.setProgress(sensorValue[0]);
return (String.valueOf(sensorValue[0])); //This goes to result

}

// Called when there's a status to be updated
@Override
protected void onProgressUpdate(Integer... values) {
super.onProgressUpdate(values);
// Not used in this case
}

// Called once the background activity has completed
@Override
protected void onPostExecute(String result) {
//Init TextView Widget to display ADC sensor value in numeric.
TextView tvAdcvalue = (TextView) findViewById(R.id.tvADCValue);
tvAdcvalue.setText(String.valueOf(result));

}
}

//Called when the LED button is clicked
@Override
public void onClick(View v) {
byte data;


// Toggle the state of LED
if(LEDState == true)
{
LEDState = false;
data = 0;
bOutPutLED.setText("LED Off");
}
else
{
LEDState = true;
data = 1;
bOutPutLED.setText("LED On");
}

try
{
//Send the state of LED to ADK Main Board as a byte
server.send(new byte[] {(byte) data});
} catch (IOException e)
{
Log.e("Seeeduino ADK", "problem sending TCP message", e);
}

}

}

Usando Google ADK

Visita la página de desarrollador de Android ADK para obtener documentación completa sobre cómo usar la API de Accesorios.

Como Mega 2560

La Placa Principal Seeeduino ADK puede usarse como Seeeduino Mega 2560. También funciona bien con el Sistema GROVE. El Grove - Base Shield puede usarse para conectar los numerosos módulos Grove disponibles.

enter image description here

Y lo siguiente es una demostración que muestra el Shield Táctil TFT de 2.8%27%27 funcionando con la Placa Principal Seeeduino ADK. enter image description here

  • Conecta la Placa Principal Seeeduino ADK al Shield Táctil TFT de 2.8%27%27

  • Formatea la tarjeta SD en modo FAT

  • Configura el interruptor deslizante de voltaje de operación a 3.3V

  • Copia algunas imágenes Bitmap de 24 bits (.bmp) de tamaño 240 x 320 a la Tarjeta SD. Algunas muestras están presentes en el archivo de aplicación demo bmp

  • Conecta la tarjeta SD / Adaptador de Tarjeta microSD (con una tarjeta microSD) como se muestra en la ilustración a la Placa Principal Seeeduino ADK

enter image description here

Salida: enter image description here

  • Consulta Shield Táctil TFT de 2.8'' para más información.

  • Oleg Mazurov de Circuits@Home es quien originalmente diseñó el USB Host Shield basado en MAX3421E. Esto fue adaptado por la Placa de Referencia ADK de Google. Su sitio tiene toneladas de información y ejemplos de código para usar el USB Host Shield basado en MAX3421E con teclado USB, Mouse, Dongle Bluetooth, Wii Remote, etc.

Visor de Esquemas en Línea

Recursos

Soporte Técnico y Discusión de Productos

¡Gracias por elegir nuestros productos! Estamos aquí para brindarte diferentes tipos de soporte para asegurar que tu experiencia con nuestros productos sea lo más fluida posible. Ofrecemos varios canales de comunicación para satisfacer diferentes preferencias y necesidades.

Loading Comments...