2017년 1월 2일 월요일

Receive hour from arduino


Hi, on my school project i have to receive an hour in this format : "hh:mm" for example : "16:12" 
My school project is an automated cat flap and i have to say on an app the hour when the cat left/entered in the house, so i have also to receive a letter like "E" (enter) or "L" (leave)
so how i can know with the code if i receive an hour or the information if the cat entered/left the house ?

--
what about sending not only the time, but also additionally the letter E or L?

you also could use a delimiter, for example a comma, which will make ist easier in App Inventor to split the information again using the split block, example:

16:12,E

-- 
Yeah it's a good idea but how to say to appinventor that 16:12 is the hour and E is for enter ? 

-- 
Because that is the way you send it from the Arduino, hour first, then a commo and then E or L.
You could also use the clock of your phone to record the time. How are you going to save the information?

--
I'm gonna save the information with TinyDB, but i just want to know how to separate the hour and the letter when i receive for example : "16:12,E"

-- 
use the split block, you can find it in the text drawer

and learn how to work with lists

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of AppInventor, then try something and follow the
 Top 5 Tips: How to learn App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

-- 

댓글 없음:

댓글 쓰기