Questo post contiene i link utili per data logging con AI2
prima di tutto il data logger; esempio con gli accelerometri
https://groups.google.com/d/msg/app-inventor-developers-library/BlM-lU2rsDE/_Ul2DZeKhJcJ
il risultato con bluestack è (simulata una scossa)
invece per collegarsi ad un bluetooth e riceverne i dati occorre:
http://www.instructables.com/id/Android-receiving-data-from-arduino-via-bluetooth-/
Lato arduino
link http://www.giuseppecaccavale.it/arduino/hc-06-bluetooth-arduino/
(consiglia il test con questa app https://play.google.com/store/apps/details?id=eu.jahnestacado.arduinorc&hl=it)
// HC-06 with Arduino
// Giuseppe Caccavale
// www.giuseppecaccavale.it
#include <SoftwareSerial.h>
int rxPin = 3;
int txPin = 2;
SoftwareSerial bluetooth(rxPin, txPin);
String message; //string that stores the incoming message
void setup()
{
Serial.begin(9600); //set baud rate
bluetooth.begin(9600); //set baud rate
}
void loop()
{
while(bluetooth.available()){
message+=char(bluetooth.read());
}
if(!bluetooth.available())
{
if(message!="")
{//if data is available
Serial.println(message); //show the data
message=""; //clear the data
}
}
delay(5000); //delay
}


