如何显示数据和值一个TextView更新? [英] How do I display data with values updated in a textview?

查看:325
本文介绍了如何显示数据和值一个TextView更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想如下面的图片中显示我的数据:

I would like to display my data as shown in the image below:

现在我的数据是显示在列表视图中显示。但问题是我不知道我收到的数据。换句话说,我不知道我什么时候会收到的温度数据时,我会收到RBPM和血氧饱和度。

Now my data is display in listview as shown. But the problem is I don't know what data I receiving. In other words, I won't know when I will receive temperature data and when I will receive RBPM and SPO2.

#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的code的更多细节。我要打印出类似这样的println(#);所以我可以找出我接收数据?

Hi I includeded the Arduino code here for more details. should I print something like println("#"); so I can identify the data I receiving??

推荐答案

有什么我们可以做些什么来帮助你们。你必须能够识别输入类型。

There is nothing we can do to help you with this. You have to be able to recognize the input type.

您可以尝试使用常规的前pression模式匹配也许(取决于两个(或更多)输入可能性的一致性。

You could try to use regular expression pattern matching to 'maybe' (depending on the consistency of the two(or more) input possibilities.

http://developer.android.com/reference/java/ UTIL /正则表达式/ Pattern.html

这篇关于如何显示数据和值一个TextView更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆