Add a boolean immediate / default argument value!


#1

Hi,

Why can’t the user set a boolean immediate / default argument value?

With integer/text it is easy - you can click on the “3” in the image below and change it to “5”,
But with the boolean argument you CAN’T - You have to drag a whole boolean expression into there…
image

As a workaround I made these “true” “false” constants:
image

But I want the basic block to support set “true” or “false” values to a boolean argument,
Like every time you clike on the argument it swap between “true” and "false"
image

Hope I was clear and we can fix that ASAP,
Please tell me if I can help,
Thanks!


#2

Because quite often your not just dropping true or false but rather putting in a expression to be evaluated to true or false.


#3

I know -
But just like with the number -
You can always drag an expression on top of it - so it override the “default” value…

I want to be able to set the simple true or false without dragging an " 0 == 0 " expression like I do now :slight_smile:


#4

Ahh you want a true block and a false blokc. Yes this makes a lot of sense.


#5

I don’t like the true and false blocks-
Think we have to make like 0, 1, 2… blocks - it will never end!

I made them only as a workaround to the main problem- no boolean immediate / default argument value
image
As you can see - if I just use this block as it is - it will be bad because I can’t tell if it use true or false!

I want the system to make it look like the last image in my first messages of this topic…!

  • Like this - we don’t have to make another true and false blocks -
    just like we dont need 0, 1, 2… blocks.

Thanks for the interest,
Hope we will get it done soon…!


#6

Hi arduino12,
Scratch programming blocks are designed in different shapes, which can be connected to each other vertically like a jigsaw puzzle.
If you want to input number or text, you need to add a reporter box.


Thanks


#7

Hi tech_support,

I don’t think arduino12 is looking for that. He wants a constant. We have this:
2020-06-03%2008_18_51-mBlock
The person using Arduino understands the values: High / Low

I think he wants more flexibility:
Va1
VAR
Same instruction that we already find but with a value that will be passed as a parameter.

However, this block was not made by mBlock but was developed by Ablock.


#8

Hi,

Thanks for your reply and looking into this-

But I still feels like you missed my point!
Look here:
https://www.mblock.cc/doc/en/block-reference/DIY.html
Even in the example gif they made a simple calls to functions with immediate values as arguments:
image
This is great - because it is easy to change an argument value - NO EXTRA BLOCK/BOX is needed!

But if I do the same - using boolean arguments:
image
Disaster! I can’t set true or false without adding my own workaround like this:
image

So I am now considering to NEVER USE the boolean and use numbers 0 or 1 for the same argument-
But this is very BAD and I don’t want to teach my classroom to work like that…!

Can’t we fix this and use the “click” methode I described on the first message??
This will make more sense - because this empty:
image
argument is awful - how can I know which value will it have if I leave it like that?

Lets’ fix it together!


#9

@Crackel

Thanks for the help-
The HIGH LOW arduino stuff irritated me as well!

This is why I made my block (For the T-Block hardware I made) to get a boolean argument like this:
image
This is also what I want my classroom to learn - that digital output in boolean and can only be true or false-
It can’t be “empty” like shows here:
image

For the pin index I used the nice integer combobox dropdown-
It allows to select a valid number (2-13) but you can also override by dragging a value on top of it - perfect!
Maybe we can make same “boolean combobox dropdown” so the user can select true or false or HIGH or LOW or drag a value on top…!


#10

Hi Arduino12,

It is probably possible to create a block that gives you a value like in a sensor. However, this value will always be the same. High for TRUE and Low for False.
aaa

Same principle as the instruction from the top but without parameters ???
I don’t know the extentions development interface but Makeblock could tell you if this is possible.


#11

Hi @Crackel,

Yes I did exactly that as a workaround - see my first message with the:
image

I made them orange - like constant variables


But I can’t put them under the orange “Variables” tab - so I put them under the “Input” tab :frowning:

This is not good because it is not easy to swich the values like it is with simple integers and texts…

Thanks for your interest - hope we can fix it ASAP if we get enough attention! :sunny:


#12

Hi arduino12,

Your way is very good because Makeblock will not touch the general block. The block you are talking about is the same block as scratch. The mBlock application tries to follow the interface and functionality found in scratch. It’s just like the CASE statement. There isn’t one and it looks like there won’t be any soon.

Maybe you can make a category: Constants and leave the categories: Variable

Note: You are working on which Anduino card (UNO, NANO, ESP32,


#13

Hi,

I got it! - I replace the “boolean” argument with “Input dropdown” with true and false!
Now I can set the default value - and the user can set true or false with one click (in the dropdown menu)!
Also support boolean expression as well! see all options here:
image

Only minor problem is the lake of the <===> “boolean” shape, but I can live with the nice round (===) shape.

This is how I made this block:

Thanks @Crackel and @tech_support for the help! (I am new here and it was my first forum question :smile: )

@Crackel,
My T-Block board is based on the cheap chinese clone of arduino nano -
I had to upgrade its bootloader so it can be flashed using the mBlock and mLink…!

I will close this thread soon if I see no activity - because my problem is 99% solved :sunglasses: !


#14

Hi Arduino12,

I love your block with the drop-down list for PINs. For the solution, I did not know that a list of values could accept a value other than the list. You will have to validate the entries.

You are new but you seem to be in control of the development module. I speak French. I can watch the translation and test.

I have a Chinese clone: Nano 3.0 ATmega328P controller card CH340 USB driver with cable for Arduino.

I also have a lot of sensors, if you want to go further. Sorry for my english it is very bad


#15

Do you have a link to documentation ???


#16

@tech_support
Here is exactly what I ment! - this is microsoft makecode for microbit I just discovered…



They respect their boolean values!! :heart_eyes: