How to save my block code with variables? #6305
Replies: 1 comment
-
Posted at 2020-07-24 by @gfwilliams Honestly, without seeing the blockly code you're using its hard to really know what is going on. Do you have a link to it in GitHub or something? Posted at 2020-07-24 by user110706 Hi Gordon! https://github.com/junguksim/project_codubot/blob/master/blockly/blockly_codubot.js If you want more, please give me reply. Posted at 2020-07-27 by @gfwilliams Thanks - I think you need to breakpoint your code eg As far as I can tell:
My guess is But either way a global Posted at 2020-07-27 by user110706 The reason why I use
So that I can't think the way that Can you explain with any examples? Posted at 2020-07-28 by @gfwilliams I mean, you could just do:
So now you check that value inside But what you were doing wouldn't work properly anyway - for instance if you make a bunch of blocks, and just the very last block doesn't have a motor set, all of the blocks will then have the motor set to 0 which I guess isn't what you want Posted at 2020-08-05 by user110706 Thank you Gordon! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-07-24 by user110706
Hello there.
I'm developing a site which can control an educational robot(by MDBT42Q).
Here's my block code that I want to save and load.

(If you can't see photo, I attached at below.)
It looks simple. First dropdown has two options(LEFT, RIGHT) and LEFT is 0, RIGHT is 1.
Second dropdown has two also, CW is 0 , CCW is 1.
It's a converted javascript code.
If I set 'RIGHT' motor at block code and save my code, and then I load it and convert, the code shows
So the loaded block code shows 'RIGHT' motor set, but actually robot moves 'LEFT' motor.
How can I save block code with right parameters that I set before?
Help me please!
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions