Skip to first unread message

Kalai Selvan

unread,
Apr 22, 2018, 12:38:56 AM4/22/18
to MIT App Inventor Forum
Hi 

Whenever i install the app it shows, 
i am using bluetooth function so for that i made all in one screen in case that need to informed.

bad arguments to select list item
- the operation select list item cannot accept the arguments:,[*empty-string*],[6]

i have attach the pictures of the block needed for this, pls help me resolve this issue
Capture.PNG
Capture1.PNG

TimAI2

unread,
Apr 22, 2018, 5:46:01 AM4/22/18
to MIT App Inventor Forum
See here:


Try replacing empty text block with  empty list block in your tinydb call

Kalai Selvan

unread,
Apr 22, 2018, 7:19:58 AM4/22/18
to MIT App Inventor Forum
Mr TimA12, 

Thank you for your time and helping me out, 

when i do the correction as mentioned above there is another problem popping out. saying Select list item: Attempt to get item number 5 of a list of length 0: ()

i attached my project aia file together. pls help me to resolve this issue. this would be really grateful for you help and i need the help terribly. 
psm2_bat.aia

Abraham Getzler

unread,
Apr 22, 2018, 12:16:24 PM4/22/18
to MIT App Inventor Forum
What do all those buttons do?
ABG

TimAI2

unread,
Apr 22, 2018, 12:26:12 PM4/22/18
to MIT App Inventor Forum
^^^ Agreed

Please give a description of what your app is supposed to do

Also:

  1. Can't see any blocks that call the tinydb, only those that store to it
  2. You probably only 2 clocks, not 7, use logic and procedures instead
  3. You could group your buttons in lists to make visibility changes easier
Message has been deleted

Kalai Selvan

unread,
Apr 22, 2018, 2:34:27 PM4/22/18
to MIT App Inventor Forum
Sir ABG,

As per request,

The top most button is to connect to the bluetooth module. Top spin and Back Spin is to communicate with uno to throw the ball in 2 rotation method. 
Next button is go next choices in the app. The start drill in throw the ball in pre-set manner based on arduino coding. 
When is choose drill button is pressed the A1, A2,A3,B1,B2,B3 button will appear where user can choose the sequence thrown to them. After choosing the seq the and shoot button is pressed the app should send the sequence to the uno. 

I am stuck at the part creating the sequence needed by the user. Thanks for your time and you help is appreciated very much
 

Kalai Selvan

unread,
Apr 22, 2018, 2:36:33 PM4/22/18
to MIT App Inventor Forum
Sir Tim,

Thank you for the reply, 

should i initialize tinydb to store the data?
where should put the block for that?

is it a way to reduce the clock in the program ?

thank you for the time. its really appreciated 

TimAI2

unread,
Apr 22, 2018, 2:46:20 PM4/22/18
to mitappinv...@googlegroups.com
should i initialize tinydb to store the data?
where should put the block for that?

No, but it seemed strange that you were saving data to a tinydb, but never using it ?

is it a way to reduce the clock in the program ?

Yes, as previously suggested, use logic and procedures with blocks to define what should happen when the clock is called
e.g. if buttonX clicked then do "this", else do "that"

Kalai Selvan

unread,
Apr 22, 2018, 2:55:31 PM4/22/18
to MIT App Inventor Forum
Sir TIM, 


I try to logic gate function in blocks. Thank you for time sir.

Abraham Getzler

unread,
Apr 22, 2018, 6:01:40 PM4/22/18
to mitappinv...@googlegroups.com
If you want to share your code with people you have to make it easy for them to understand it.

The AI2 Designer component renaming facility is  easy to use, and the names propagate instantly to all
the blocks using the newly renamed component. (edit)

Good names tell the component type (btn = Button, lbl=Label, txb=TextBox, etc) and the purpose of the thing being discussed:
 

The top most button is to connect to the bluetooth module.  btnConnect

 
Next button is go next choices in the app. btnNext
 
The start drill in throw the ball in pre-set manner based on arduino coding.  btnStartDrillIn
 
When is choose drill button is pressed the A1, A2,A3,B1,B2,B3 button will appear where user can choose the sequence thrown to them. btnChooseA1, btnChooseA2,...

 
After choosing the seq the and shoot button is pressed the app should send the sequence to the uno.  btnShoot


Most of programming is taking complicated ideas and breaking them down into simpler ideas to fit between our ears.

Picking good names is half the work.

ABG
 

Abraham Getzler

unread,
Apr 22, 2018, 6:25:36 PM4/22/18
to MIT App Inventor Forum
I am stuck at the part creating the sequence needed by the user.

See How to Work With Lists in the Lists section of FAQ

There are two alternatives to sending a sequence:

  • All at once
  • One item at a time
I don't know which one fits the device you are connected to.

If you control the programming on both sides,
and if you want to send it all at once,
 you might try coding
the sequence all in text using the text JOIN block:
'A3,A1,B1,B3,A1,...'
set lblMessage.Text to JOIN(lblMessage.Text, ',A3') in btnChooseA3
and then in  btnSend transmit lblMessage.Text.

If you can only send one item at a time, queue up the text items in a list,
adding new items to the list as their button is pressed,

and sending item 1 when the Send button is pressed.
Arrange for the other device to send a message when it is ready for the next message,
and when the OKAY message arrives,
  remove item 1 from the queue,
  check if the queue is not empty,
    if not empty send item 1

Using a queue simplifies the problem, and lets you only need 1 Clock Timer.

Some examples ...

ABG

 
Reply all
Reply to author
Forward
0 new messages