I am trying to make a "block" that reads a sensor

I am trying to make a block that sends makes one of the pins on the pi controller serial, then sends a character code out to the pi to signal it to send data, then reads that data then outputs it from the block.

As you can see from the quotes around the word block in the post, I am really new to block programming and don’t even really know how the pieces go together and what blocks actually are at a low level.

I found some videos, but they don’t explain it well in that they get into the how bit before giving an overview as to what is happening where and in what language.

I will try chat gpt and see if there is a blockly block share somewhere.

The blockly programming on this forum is specific to the XRP robot platform and XRPCode IDE that supports the XRP. It sounds like you may be looking for general support for creating your own blockly program? If so Google has a developers guide to creating blockly programs.

Kind of I was looking to make a block for the IDE that would allow someone to connect a hitachi-LG HLS-LFCD2 lidar unit to the xrp platform then access it with a “block”
My big problem is I really don’t understand the nature of blocks. I get how to use them, just not how to write one and import it into the XRP environment.

Best,
KWOL

1 Like

Oh that sounds very cool.
We are working on a future release to work with devices that have a python library that is supplied and then we will have a general getter and setter blocks that can work with it. Let us know if this would work as a solution for you, if so we can keep you informed as the release progresses.

2 Likes

Another possibility might be to create a block (under functions) in Blockly, although, at this time, there is no good way in the IDE to write a multi-file program where you could “import” your block. Coincidentally, we just had a conversation 20 minutes about about multi-file programs, so maybe something will happen there.