Correct use of the "pinMode" command, my two extensions for this


#1

Standard mBlock environment extensions automatically add commands “pinMode” to the “setup” section. This leads to the fact that in some cases errors occur. For example, it is not possible to pass a pin number as a parameter when creating a block.

To solve the described problem, two approaches can be used. First, switch the pin mode not in the setup section, but immediately before each read or write command to the port. Second, opt out of automatic switching, using manual pin mode switching instead.

I created two extensions to solve this problem. The first of these is very simple and is called “Common UNO Device”, it is well suited for the first steps, because it does not contain anything superfluous. The second is called “Advanced Arduino Extension” and allows you to implement complex projects. Usage examples can be seen here: https://goo.su/AAE_mBlock

I hope that my two extensions will be useful to users of the environment.

I have a big request to the developers to add the “Common UNO Device” to the list of those that the “Upload Mode Broadcast” extension works with.


#2

Nice! I’ll check them out!