Strange problem reading serial via Bluetooth

GolamMostafa:
Can you please tell/show me with an example data/string item (that is coming from your BT) how does the 1st argument (received - data)/256 + 9) of the following code (taken from your sketch) evaluate to Dpin-11?

I'll try to explain: "received" is the int derived from the string sent before the first *. "data" is defined as received % 256, so if I subtract received - data, I get either 0 (first fader), 256 (second fader) or 512 (third fader). If I divide that by 256 and add 9, I get the pin number that I want.

Example: If the received number is 534 then

data = 22
(received - data) = 512

and I get 9+2 = 11 for the pin number.

Robin2:
Either wait until the slider stops and then send the value for that slider position

Might be possible, but I'd like to be able to monitor the constant change to the LED's brightness.

OR
send values at pre-determined time intervals - for example every 200 millisecs.

Could be a possible solution, but I am not sure how to do this in App Inventor.

In the meantime, I found out that the problem goes away if I declare "ledpin" as float! I'm still not sure what is going on here, but I think I can work with that solution at the moment. However, I'd still appreciate it if someone could tell me exactly what is going on.