Blockly wish list - inverting digital inputs and outputs

TerryRy

Member
Playing with Blockly over the past week has demonstrated its value in introducing young and old to the coding world. One thing that I find great is the assignment of labels to inputs and outputs. However many designs use a switch shorting to ground when operated and a LED pulled to ground when turned on ( ie. the logic is inverted).

This makes it very difficult to read the Blockly graphical representation as some inputs and/or outputs may be on when they are off (and off when they are on).

In the input/output table would it be possible to have an additional column to tick if a particular pin is inverted? I can see that the Blockly graphical representation may need to switch between PICAXE pin view and the real world view (user view).

Great work.
 

Technical

Technical Support
Staff member
Although we understand the idea we are not keen on this idea because the pin is always high/low (on/off) no matter what the output device is doing. Therefore adding inversion could confuse others.

The problem here is a conceptual one, and it is the state of the pin, not the input/output device, that is the state of importance.
 

TerryRy

Member
Thank you for your reply Technical.

I could see that adding a invert buttons to the input output table would be a two edge sword that whilst simplifying an end to end model would add another layer to the understanding process.

My problem was crystalised when I wanted to explain the operation of a simple Blockly program using switches pulling to ground, to my 11 year old granddaughter. Trying to explain that when a switch was off it was on as far as Blockly was concerned resulted in a confused face. From her perspective, she was coming to grips with switches and motors not what is happening on a particular MCU pin.

Thank you for considering the problem that would not exist if switches pulled to Vcc and motors/LEDs were pulled high to turn on.
 

Technoman

Senior Member
I fully subscribe to this idea. The positive logic would be set by default.

I like the idea to provide, for beginners, the table containing labels for input/output and the positive/negative logic used for each. At first, I want the students to focus on the algorithmic side, independently of the hardware used.
 

BESQUEUT

Senior Member
I fully subscribe to this idea. The positive logic would be set by default.

I like the idea to provide, for beginners, the table containing labels for input/output and the positive/negative logic used for each. At first, I want the students to focus on the algorithmic side, independently of the hardware used.
I fully subscribe to this idea
 
Top