2014년 12월 1일 월요일

Arduino and app inventor 2


I made a app in app inventor 2 to control an arduino and some step motors by bluetooth .
Make 3 buttons to save memory positions, 1 click save, all others click's return to saved position and long click to erase memory.

Instead having 3 buttons to do this is possible to save memory positions in tinydb?

1 button to save positions, one button to choose saved memories and another to erase one or more memory positions.

Can someone help me?



--
You can use the List component and save it in TinyDB. But you will need one more button maybe to navigate through the list to remove or choice something.
I think its better to use ListView or ListPicker. I am right now not sure but I think ListPicker is what you need. Have a Forum search and you will see many examples about it.

--
Yes i think is better list picker, but i d'ont know how to do it, try several ways with no success...

--
Sorry, unfortunately i cant help here because I never dealt with listpicker. I even have problems to add items into the list. I am not even able to have a listpicker, a button and textbox. and whenever I press the button, the textbox.text should be added to listpicker. I think that is the idea you need too...

--
Thanks anyway Shuan.

--
I will try it later and if i did it i will tell you

--
Here you are. It was really easy and I think that is why we couldn't find it through the search function of this Forum. AI2 is all about logic thinking. I hope this example will help you to finish your program.

With Save Button you save the textbox.text into the listpicker. With the Delete button you delete the selected item from the listpicker. With the Choose button you display the selected item text into a label.
You can also write the commands for the Choose Button directly into the AfterPicking block

Ps. do not forget to save this into TinyDB


listpicker.aia

--
I think i would not have more replies... sorry for the delay

Thank you so much shuan,

I will try and i give feedback.

--
Hi shuan, this is the design off my app..it's possible that the text box appears on click or long click? i want a more clean design.



--
Save button, call positions memories button and delete.

--
Hi, can you say it again?  So these are the buttons, right? 3 buttons and each button has a background image, right?  And you want a text box to appear if you click on one of these buttons or long click? Just put inside the button.click block the command for a textbox to appear. TextBox1.visible = true .... ?

I have no problems to give you my email address. But I dont usually use email and almost never check my emails. I am not used to it. I was born in the 80s and grew up in the 90s. We were used to go outside to the mailbox to check for mails :--D. And on the other hand I rather prefer to solve the problem here so that other users can benefit from it...

--
Ok i understand  and it's fair.

I'm struggling with this...

Yeah the first button click is for saving a memory position  and appears a text box to write your desired title, ex: "memory 1" or "memory 2", and it's saved in tinydb .
Second button chooses saved positions in a listpicker  in tinydb.
And third to delete saved positions in tiny db
.
Is it possible the listpicker items call bluetooth client?

--
I think it is possible. If u choose an item from lipsticker then write thr codes bkuetooth client inside the "afterpicking" block. If u want call the bluetooth client only with a specify item of lipsticker then I think it should be possible to use an If block to compare the item text with the text of the item you wanna use to call bluetooth client. I am with mobile online but I hope you got my point,  else I will explain it again ofc. :)

--
Yes it possible, i made it working :) 

I will continue the development of my app, thanks Shuan

--
Hey i have invented an app on mit2. while using, the app is showing connections and is  connecting to hc-05(i'm using) but while sending data over the bluetooth arduino is not responding. This my minor project . I have to submit it by Nov- 22 .plz someone help me.

or plzz send me blocks for inventing such app (only transmit through android )

--

--

댓글 없음:

댓글 쓰기