>
> Ytai, I have same sensor HIH4030, and I cant even get Voltage, does it
> means that my sensor is not working?
>
Heres my code below:
class Looper extends BaseIOIOLooper {
private AnalogInput aiH;
@Override
protected void setup() throws ConnectionLostException {
aiH = ioio_.openAnalogInput(41);
runOnUiThread(new Runnable() {
public void run() {
Toast.makeText(getApplicationContext(),
"HIH4030 Connected!", Toast.LENGTH_SHORT).show();
}
});
}
public void loop() throws ConnectionLostException {
runOnUiThread(new Runnable() {
public void run() {
try {
txtVoltage.setText("Voltage " + String.format("%.2f", aiH.getVoltage())
+ " V");
txtHumidity.setText(String.format("%.2f", (aiH.getVoltage() - 0.958) /
0.0307) + "% RH");
progressBarHumid.setProgress((int)((float)(aiH.getVoltage() * 100 / 3.3
)));
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ConnectionLostException e) {
e.printStackTrace();
}
}
});
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
Cant even get Toast message to appear.
>
>
--
You received this message because you are subscribed to the Google Groups
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.