Extending the toolbox with custom functions?

AxeHacker

New Member
I was wondering if it's possible to create new toolbox items in PE? I have been searching around and have not found any information on how to do this. For example, I'd like to add a "Custom" category (what it's called in the XML files), and then in this category, add blocks for an RGB LED driver that I have working in I2C blocks. Rather than copying and pasting functions between projects, it would be swell if I could just have custom toolbox categories at my disposal. Any information on how to do this would be greatly appreciated!
 

Technical

Technical Support
Staff member
Use the BASIC Block for this. You can pre-save 'snippets' of PICAXE code that can then be reopened by using the 'Open file' menu when you right click over the BASIC block.

In effect this gives you customisable blocks.

BlocklyBASIC.PNG
 

AxeHacker

New Member
Use the BASIC Block for this. You can pre-save 'snippets' of PICAXE code that can then be reopened by using the 'Open file' menu when you right click over the BASIC block.

In effect this gives you customisable blocks.

View attachment 19146
While I definitely don't disagree with you, I was hoping that there would be a way to create more "macro"ish blocks to simplify things for some of the students. For example, I would love to create a block for the I2C RGB LED controller I just implemented, but give kids access to things like setting the device ID in a variable block, rather than using Basic blocks with #change the ID here. Or it would be great to be able to set the R, G, B values from blocks.

Anyhow, my guess is that there are no plans to support extension of the block toolbox by end users, which is a real shame, but I understand.
 

Technical

Technical Support
Staff member
It is actually a Blockly limitation, its not currently possible to add user defined 'macro' blocks. Any such blocks would need to be carried in the saved xml file itself (so the file could be shared between app, web and PE6 variants), and Blockly simply does not support this.

By using the BASIC block you have a workaround, as the BASIC block is a predefined block already available in all versions.
 

Technoman

Senior Member
There is a special block for the AXE 023 board in the motor section...

What about the AXE 020? Is it planned soon?
 

Technical

Technical Support
Staff member
Good question, it is actually same as CHI035 so we will change the label on this block to say both CHI035 and AXE020. So use CHI035 block.

CaptureAXE020.PNG
 
Last edited:

Technoman

Senior Member
Thanks.

On page 4 of the AXE020 data sheet, it says "controlled by outputs 4 to 7.". In order to provide the same detailed information as in the CHI035 data sheet, I suggest to replace it by "controlled by outputs B.4 to B.7."
 
Top