I found out how to send data from the app to cosm website
here is a video showing an example app as well as a brief explanation of how to use app inventor
http://www.youtube.com/watch?v=Y-iDuUQCxQA
You can download the app here >>
<a href="http://speedy.sh/d4444/bluetoothAppCosmExampleTemperature1.apk">Download at SpeedyShare</a>
Here you can download the source >>
http://speedy.sh/Vwwww/bluetoothAppCosmExampleTemperature.zip
Here is arduino code I used (note that you need OneWire library for it to work)
#include <OneWire.h>
int DS18S20_Pin = 2; //DS18S20 Signal pin on digital 2
//Temperature chip i/o
OneWire ds(DS18S20_Pin); // on digital pin 2
void setup()
{
// initialize the serial communication:
Serial.begin(19200);
// initialize the ledPin as an output:
}
void loop() {
float temperature = getTemp();
Serial.println(temperature); delay (250);
}
float getTemp(){
//returns the temperature from one DS18S20 in DEG Celsius
byte data[12];
byte addr[8];
if ( !ds.search(addr)) {
//no more sensors on chain, reset search
ds.reset_search();
return -100;
}
if ( OneWire::crc8( addr, 7) != addr[7]) {
Serial.println("CRC is not valid!");
return -1000;
}
if ( addr[0] != 0x10 && addr[0] != 0x28) {
Serial.print("Device is not recognized");
return -1000;
}
ds.reset();
ds.select(addr);
ds.write(0x44,1); // start conversion, with parasite power on at the end
byte present = ds.reset();
ds.select(addr);
ds.write(0xBE); // Read Scratchpad
for (int i = 0; i < 9; i++) {
data[i] = ds.read();
}
ds.reset_search();
byte MSB = data[1];
byte LSB = data[0];
float tempRead = ((MSB << 8) | LSB);
float TemperatureSum = tempRead / 16;
return TemperatureSum;}
And here is the feed I created for the app -> The feed is available here - https://cosm.com/feeds/118188
In order to send data from or to your own COSM feed you have to modify the URL as follows (parts that you have to fill in are in capital letters):
http://api.cosm.com/v2/feeds/YOUR FEED ID/datastreams/YOUR DATASTREAM ID.csv?key=YOUR API KEY&_method=put
Then copy and paste the URL into a QR code generator, generate a QR code and scan it using the app. You might as well use the feed I created for the app - it's the default URL set in the app so you don't have to enter it - it's already there
If you have any questions feel free to ask them