Asked — Edited
Resolved Resolved by DJ Sures!

Different Pages In Blockly

I'd like to request to have multiple pages in Blockly, this way I can keep things nice and organized. Also on each page could we have it basically full page so I don't have to zoom in and out constantly. The selections of create new variable, camera etc could all be located in in small squares that could be pulled up as needed. When you running multiple bots with different conversations it just plain takes a lot of room. At the end of each page it could ask would you like this to connect to page (2 or 3 etc) and then you link them all together or have multiple things happening at once.

It sure would have been nice to have this and then just continue onto the next page. Very limiting as is. As I'm build more complex robots need more room in Blockly to handle all of the programming. Does it not make sense to be able to add more pages in Blockly as you would with other programming languages?


Related Hardware EZ-B v4
Related Control Stepper Servo

ARC Pro

Upgrade to ARC Pro

Discover the limitless potential of robot programming with Synthiam ARC Pro – where innovation and creativity meet seamlessly.

#9  

Ok I understand on how Blockly is limited but how would you write it if using Javascript. In the above picture it shows a button that can be pushed on the desktop and the underlying code is in Javascript. Being able to push a button to zero it (position 1) even would help. If this is not possible I will move on the next scenario with relays wheres it whenever it loses power and re powers up it goes to 1 but trying to do it in code first. Seems like somehow it would be able to clear itself with code.

PRO
Synthiam
#10  

I created a new Blockly block that accepts raw javascript. It'll be in the next release...

User-inserted image

I'm not quite sure if i understand your last response. Are you asking how to have an initialization script when the robot connects to move a servo to a position? You can do that in this document, which explains how to create an initialize script: https://synthiam.com/Support/Tips-to-Make-a-Robot/initialize-servos

If you're asking about "how to have a button do something", then you can create a custom interface using Interface Builder with a button. The button can execute any code that you add to it: https://synthiam.com/Support/Skills/Remote-Control/Interface-Builder?id=16063

#11  

I really like and appreciate how you can make these additions on the fly and that one is going to come in handy. I primarily work with the Stepper servo skill and in there it mentions how you can zero it (position 1) with a script, ok how do you write the script for V21 to be zeroed.   Currently there is a ControlCommand block in Utility which I think is essentially very similar to the block you just made. While inside the ControlCommand block you switch the type of code to Javascript to handle the proper syntax needed. This is what I thought was close but it doesn't work     ControlCommand("Stepper Servo", "Set as Home", "V21"):

#12  

There is a big difference between making a button and pushing make it go to location 1 and having a button to zero it. The difference in the first scenario is you may be at location 1252 and if you push the button it will go towards location 1 (and may hit some things along the way), wheres a zeroing button may be at position 1252 if you push the button it the internal counter actually resets to location 1 and the exterior position on the screen goes to 1 so there is no movement at all. This comes in handy when you are doing your own controlled homing (one axis at a time) with infrared switches etc.

#13  

I understand that DJ said you can add a button to a custom interface with code to set the current position as home. You can put any code behind the button to be executed. In your requested example, the javascript code would be...


ControlCommand("Stepper Servo", "SetAsHome", "ID");

You can replace the ID with the stepper servo ID. For example,


ControlCommand("Stepper Servo", "SetAsHome", v21);

The code you are pasting for SetAsHome is incorrect because it has spaces where the correct command does not. You can find control commands by right-clicking in the javascript editor or viewing the cheat sheet. Here are two examples pasted...

PS, for further reading, these examples are documented on the ControlCommand() manual page here: https://synthiam.com/Support/Programming/control-command

  1. In this case, the editor has been right-clicked with the mouse, and the popup of ControlCommands is visible. I navigated to the stepper servo robot skill to view the supported ControlCommand list.

    User-inserted image

  2. In this example, I'm using the Cheat Sheet and navigated to the Stepper servo to view the supported ControlCommand list.

    User-inserted image

Lastly, I was having difficulty following this thread because the topic changed, and there were 30 robot skills selected. Please select only the robot skills regarding this question; otherwise, it is time-consuming for us to filter through to understand and answer promptly. Thanks for understanding!

#14  

Thank you, I think you solved it. That is all that was asking -how to set as home a certain Virtual ID. This is all very obvious to you but the "  " is misleading to me as you actually take them out of there on the ID but leave them on the other parameters.

PRO
Synthiam
#15   — Edited

Ah, that's a good observation to that response. The "V21" can be in quotes or not. That's because it is a constant, and constants do not require quotes (although you can use them if you prefer). For example, D3 is a constant that actually contains the integer value 3.

That's because D0 is actually a 0 for port 0. etc... But V0 is actually a value of 24 because it's port 24. This is somewhat documented in the javascript manual under the Constants section here: https://synthiam.com/Support/javascript-api/javascript-overview

You can put the V21 in quotes or not. It won't matter because the value will be used no matter what. But for strings, they must ALWAYS be in quotes. A constant is a variable that contains a value, so in this case, they have their own quotes.

#16  

Those couple posts were very helpful and I fixed Setashome and

User-inserted image

tried it with quotes and without, but it only goes through without. I thought that it worked but when I looked at the location, it was still at 1000 and did not make it the one position.  I made a quick program to keep the variables current, but it did not change.

User-inserted image

User-inserted image

User-inserted image