2016년 12월 1일 목요일

smart home Arduino project with MIT app inventor


Hello Please I need some help because I'm trying to design an application that can control a smart home with an Arduino controlled with a smart phone (I did the application using MITapp inventor).
  
An application that allows me to control the opening and closing of shutters, lighting of the house, a sensor to measure the temperature and humidity (DHT11).
 
 But I have a problem with the temperature display and humidity as it appears on the same label and what should I do to display the temperature in a label and humidity to another label? Thank you kindly help me 
Here is my program:







I tried with this programme but it doesn't work



-- 
You need a way to mark your sensor reading messages to identify them as either temperature or humidity, so the receiving blocks will know where to show them.

For example, println("T=",t);
println("H=",h);

and when you receive on the AI2 side,
If connected then
   if bytes available > 0 then
     set m = incoming message
     if the front of the message is "T=", copy the rest to the temp label
     if the front of the message is "H=", copy the rest to the temp label

See the text blocks for length(), split at, segment.

--  
You are probably receiving both T and H in the same message m.

Try setting your BT Client Delimiter Byte to 10 in the Designer, and set the BTClient.ReceiveText Number of Bytes to Receive to -1.

This will get you only one reading per message because it will split them at the Line Feed.

-- 
thank you for your reply
I have a question:: Can I take a break in the application (as I do in the Arduino (delay))?
can i do this with timer ??

-- 
AI2 has no wait() block,
but you can use a Clock from the Sensors drawer and set it as a timer.

-- 
see Scott's "Please Wait" method here Wait or delay method fail

--

댓글 없음:

댓글 쓰기