Output C variable to mblock


#1

Hi, im working on an extension for arduino uno and reading an sensor values
my problem is that i want to my C variable shows in mblock
for example how can i set my C values to a number block in my extension ?


#2

Could you please be more clear about what you want?

Thanks for your time,
Best_codes


#3

yes. for example i want to make an extension that get X Y Z from the mpu6050 gyroscope sensor and show its numbers on the screen of mblock.
i created some blocks for sensor setup but in the next i want to my X Y and Z variables in my C code output to the mblock.
how can i do this?


#4

There is probably already an extension to do this, but if there isn’t, then I will give you directions.

Check this box while you are on the block settings tab and under the block you want to make have a checkbox:
Screenshot%20from%202022-07-11%2008-33-24
(Note: You may have to scroll down over the different blockk settings until you find the check box)

Now the box should look like this:
Screenshot%20from%202022-07-11%2008-34-26
Click save:
Screenshot%20from%202022-07-11%2008-35-02
Now preview your extension by going to the extension preview page or clicking the “preview” button.

This will create a checkbox next to your block.

If I wasn’t clear enough, or for more information on how to make your block actually return accurate information, please mention me as @Best_codes.

Thanks for your time,
Best_codes


#5

@Best_codes thanks for your tips but my problem wasnt it.
i turn on the (( This block comes with a checkbox for reading value )) but the number was showed was not my C variable .
i have a varable in my Arduino/C code that i want to write it in this block that showing on the stage or screen
my problem is : How to write an Arduino/C variable to extension Block

thanks for your attention ( sorry for my bad English )
sina