user110706
Member since Mar 2020 • Last active Aug 2020Most recent activity
-
- 7 comments
- 1,889 views
-
-
The reason why I use
validate
is, when I don't choose any value in dropdown, so the default value should be set, but unfortunately it doesn't. The value wasundefined
when I don't select any value in dropdown!if(motorValid_ === false) { motor_ = 0; <----------------------- here because motorValid never got set } else { motor_ = block.getFieldValue("turnMotor_") <--- never gets called
So that
block.getFieldValue("turnMotor_")
line works well, because of validator.I can't think the way that
just check what's going on when creating the code in Blockly.JavaScript.*
.Can you explain with any examples?
-
Hi Gordon!
Thanks for reply.https://github.com/junguksim/project_codubot/blob/master/blockly/blockly_codubot.js
You can watch first block(codubot ready)'s code at first line.
Second block(motor_move)'s code is at line 178.If you want more, please give me reply.
-
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.
/* motor_move function code */ motor_move(1, 0, 0, 0, false); //motor_move's parameters : motor_move(motor, direction, velocity, angle, wait);
If I set 'RIGHT' motor at block code and save my code, and then I load it and convert, the code shows
motor_move(0,0,0,0,false);
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!
-
Hi!
I have some problems.var ir_adc = [0, 0, 0, 0, 0]; var ir_adc_loop = setInterval(function() { i2c.writeTo(0x0A, [1, 10]); i2c.writeTo(0x0A, [14]); var ir_i2c = i2c.readFrom(0x0A, 10); ir_adc = [((ir_i2c[0] * 256) + ir_i2c[1]), ((ir_i2c[2] * 256) + ir_i2c [3]), ((ir_i2c[4] * 256) + ir_i2c [5]), ((ir_i2c[6] * 256) + ir_i2c [7]), ((ir_i2c[8] * 256) + ir_i2c [9])]; }, 10);
Here is my code for Espruino web ide. ( To get IR Sensor value)
So if I upload this code to robot,>ir_adc =[38,44,43,41,41]
I can get my ir_adc value.
But I want to get ir_adc value in my blockly_something.js.
Is there a solution to get IN-ROBOT value at my vscode SUPERCOOL?Thank you.
Hi
I want to make a block which can load a txt file and can use the file's content.
I found helpful link to use file import block below
https://groups.google.com/forum/#!starred/blockly/grwyJKzRg60
I think it's possible in blockly, but I don't know how to use the block in that link in my espurino web ide project.
Can you help me?