Store variable into list - could not fit int to byte error 514

Hi

as I create the list, I cannot fit the variable in second slot

Error 514 Could not fit element 2 into 1 byte

how can I get the lowest byte of an integer or define the variable as byte ?

thanks

Do It is your friend:

P.S. Make sure your Slider has a range 0-255.
Don't let it round up to 256.

there is no do it, I am not sure what you mean

also as mentioned, I have an int value (although the slider is maxed out at 255 of course)

image

image

Use the companion app and Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

found the companion app. it is asking for a code
why is it so cryptic

the do it is greyed out

image

The convert base10 to binary block is a fraud.
It does not give you a single byte packed binary number.
It gives you a string of text 1s and 0s that look like binary, but is counted as a number like 10 million 11.

well if app inventor does not allow me to turn a slider value to an hex byte, I am screwed, I'll have to find something with more potential

simple thing to do in any language

It allows it, you are looking in the wrong place.

AI2 Duck Typing gives you automatic conversion.

math_bitwise

The BlueTooth send Bytes List block takes decimal numbers below 256 and renders them however you want at the receiving end.

1 Like

Sample of AI2 bit manipulation:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.