Bad Argument to * with BletoothLE

Hello friends!
I'm a student, I'm learning how to create an app on MIT App INVERTOR, I'm getting an error reading the percentage value constructor from the value I read. Error like this


I don't know what's wrong. And how to fix it
Please guide!
Thank you!

These are my reading and processing blocks!
blocks (2)


Math blocks can't work on lists, only single numbers.

You received the list with 4 items 211, 2, 0, 0.

What kind of number is that?

Looks like I mistook 211,2,0,0 as a sequence of numbers

That's the value I get when I send sensor data from the kit to my device. I read it as bytes

You have to figure out what is going on upstream, at the source.

It looks like a tennis instructor got his hand stuck in the tennis ball machine and it is throwing his fingers at you one at a time.

Could you show the transmitting code?

I don't use Arduino I use PSoC.
This is my data submission code

Reading your code, I see (Uint8 *) which I imagine to be a type of sequence of 8 bit unsigned ints (bytes), and the number 4, which matches up with your length of received list and numeric ranges of those 4 items.

The question is, what is the data type of &adc_result_0, which I imagine is what you are trying to send via meat chopper.

What could be 4 bytes worth of data?

A 4 byte integer?

Some kind of float value?

Where is that value type defined?

This is how it is declared. It is a global variable
image

So you have a 32 bit integer, but you cut it up into 4 bytes to send it?
I see BLE has blocks to receive integers.
That would imply there should be commands upstream to send an integer.

That would make more sense than having to do reconstructive surgery at the AI2 side, right?

Yes I will try to implement it, however can I not change BLE instead change AI2 or not?.

Taking a blind guess that the low order byte is arriving at item 1, and that this is a positive number, I would guess that this represents
211 + (2 * 256) + 0 * 256^2 + 0*256^3 =
211 + 512 =
723.

Does 723 make sense as a measurement value?

Exactly it is a measurement value I am using.

Good.

Do I need to show you how to select items from the list and combine them like I did?

If that is possible, I would like to thank you!
I just found out about MIT App INVERTOR, I posted a post but I haven't received any help yet, I also did some research but I still have a lot of things unclear. Hope you can guide me!
Thank you!

I am running out of time here, and must be offline for a day or two.

I cede control to other board members who can handle this.

Thank you for this!
How can I get guidance from others?

Show effort and post it.
They will see, and respond if you have put in effort.

Cám ơn bạn rất nhiều về điều này.
Sự giúp đỡ của bạn đã giúp tôi có một ngày tốt lành!
Chúc vui vẻ!



1 Like