2017년 7월 29일 토요일

HELP ME! How to exchange image.


Good Evening. I just wanted to know how to 2 image exchange in app inventor. When light dependent resistor sends high value of data to app it will display the image I set for sunny but when it is raining and the app receives data from rain sensor, the image will change into raining. 

--
Just do the same as you have done with your text label (Sunny or Shady) but use the image.picture block instead and feed it the correct image?

--
2 sensors are working. so if it is raining the rain sensor will sends data to app and then i want to show the image raining and then when rain sensor stop sending data and no rain and the ldr receives data that it is sunny the raining image will be sunny image.

--
Unless I am missing something here:

See aia

--
when rain sensor stop sending data and no rain 
So the rain sensor will send no data (and therefore have no events trigger?) if there is no rain?

That would call for a Watchdog Timer design, where you keep a TinyDB tag msLastRainDrop with the last
 time (in milliseconds from 1970) that the rain sensor event triggered, and a repeating clock
that checks Clock1.Now() in milliseconds against the TinyDB value, to see if enough time has passed
(1 minute = 60000 ms)
since the last raindrop to announce there's no rain.

When a rain drop arrives, set the TinyDB value to Now in milliseconds, and announce it's raining.

The Clock component is in the Sensors drawer.


댓글 없음:

댓글 쓰기