Calling a Function through Bluetooth Mobile

see the doc

Send1ByteNumber(number)

Decodes the given number String to an integer and writes it as one byte to the output stream.

If the number could not be decoded to an integer, or the integer would not fit in one byte, then the Form’s ErrorOccurred event is triggered and this method returns without writing any bytes to the output stream.

of course then the Arduino receives a number so don't mess up with it subtracting '1'. you want to check what you get (should be between integer 1 and 40 and in that case subtract the integer 1 and you get your index for the function (or send directly the value minus 1)

So whats need to changes from sendtext to send1byte number?

use Send1ByteNumber instead of SendText in the MIT app and see what you get with the sketch I gave you

it doens't work on the mit app it says cannot read as integer, i have also try to using value of text and number but still not work

i mean the error is in the apps it i change to send1ByteNumber

post details please if you want help.


It shows an error from the apps when usinf sendbyte

did you change anything else?
seems it can't connect
image

show the MIT app thingy

sorry it just a technical error, but the real error is Error 510:Could not decode ''' as an integer


I have also try to change the text to number but still the result the same

what is shown in
image

shouldn't that be ListPicker2.Text?

pardon me?

I was pasting the image

do you see 10 or 12 or something else?

so what it do is when the click on each animation it shows list of 1 to 40 based on the variable global. when click the specific number those is the value of selection

so the value of selection based on the selection of list picker later in the apps

did you fill up the 40 animations before sending to BT ? (start button I assume)

lol havent try it nice logic, lemme try

if you don't fill them up, the there might be nothing selected and when you try to send that it fails.
(you should double check by the way that there is a selection before sending the command)

got 0x0A
got 0x0A
got 0x0A
got 0x0A
got 0x0A
got 0x0A
got 0x0A
got 0x0A

it does show into font

i have change the variable into number and text and the output is the same