如何使用文本视图中更新的值显示数据? [英] How do I display data with values updated in a textview?

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

问题描述

我想显示我的数据,如下图所示:

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

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

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;
  }
}

我在此处包含了 Arduino 代码以获取更多详细信息.我应该打印类似 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.

您可以尝试使用正则表达式模式匹配来可能"(取决于两个(或更多)输入可能性的一致性.

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/regex/Pattern.html

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

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