2015-12-22 19 views
0

我想如下面的圖像中顯示我的數據: display in textview如何使用textview更新值顯示數據?

現在我的數據是在列表視圖顯示,如圖所示。但問題是我不知道我收到了什麼數據。換句話說,我不知道什麼時候會收到溫度數據,什麼時候我會收到RBPM和SPO2。 listview display

#include <PinChangeInt.h> 
#include <PinChangeIntConfig.h> 

#include <eHealth.h> 
#include <eHealthDisplay.h> 


int cont = 0; 

void setup() { 
    Serial.begin(9600); 
    eHealth.initPulsioximeter(); 

    //Attach the inttruptions for using the pulsioximeter. 
    PCintPort::attachInterrupt(6, readPulsioximeter, RISING); 
} 

void loop() { 
//getting the value as a variable 
int BPMval= eHealth.getBPM(); 
int SPO2val = eHealth.getOxygenSaturation(); 
float temperature = eHealth.getTemperature(); 

Serial.println(BPMval); 
Serial.println(SPO2val); 
Serial.println(temperature, 2); 
delay(250); 
} 


//Include always this code when using the pulsioximeter sensor 
//========================================================================= 
void readPulsioximeter(){ 

    cont ++; 

    if (cont == 50) { //Get only of one 50 measures to reduce the latency 
    eHealth.readPulsioximeter(); 
    cont = 0; 
    } 
} 

您好我在這裏includeded Arduino的代碼,瞭解更多詳情。我應該打印一些像println(「#」);所以我可以識別我收到的數據?

回答

0

我們無能爲力,幫助您做到這一點。你必須能夠識別輸入類型。

你可以嘗試使用正則表達式模式匹配「也許」(取決於兩個(或更多)輸入可能性的一致性。

http://developer.android.com/reference/java/util/regex/Pattern.html

+0

嗨@mawalker我張貼Arduino的代碼。因此,是否有可能讓android知道它收到了什麼?就像我println(「#」)將android識別它? – Spotty

相關問題