2017년 7월 25일 화요일

App Inventor for weather sensor




Good Morning. I have a problem in my android app. My app receives data from the 3 sensors (Light Dependent Resistor, Rain Sensor and Temperature Sensor). It's all working when it comes to sending data from the app but my problem is that I want to display an image when for ex. Light sensor sends data with the value of 1000 it means it is sunny. So I will click a button and it will display the image that I set. Then the next thing will happen is that when the sensor changes value. The current value was still there with the new value. Meaning, the old value is still there with the current value. Please Help.

--
Please help me. Thanks

-- 
What I wanted to happen is that when it receives other data like for ex. for light dependent resistor and its value is 1000(sunny) and currently its value is 100(shady). When it display the sunny image then when I click the button for showing the weather  it will display the shady image and the previous image will gone.

-- 
This might help you with the logic Justin
Chapter 18. Programming Your App to Make Decisions
One way to handle the weather icons is to use only a single image control;  when it is shady, set image1.picture to shady.png else if sunny then set image1/picture to sunny.png  perhaps.

-- 

댓글 없음:

댓글 쓰기