E-Book inaccuracies

Just started using PB and going thru the tutorials in e-book. I have only worked with the first 3 or 4 samples and see what appears to be a number of mistakes. I did send some info on them using the Chat feature of the e-book's URL. But looks like I am going to be discovering a bunch more, so should I list here?

I am using the latest e-book version "Update: 11. Nov. 2022 Ver. 1.13"

Some examples:

1) In 2.2.5, step 4 states "In the Condition field, place the block in the operators category to create the expression when the button is not pressed". Where is the "Condition field"? I am guessing it should say to drag the "Not" block from the Operators category?

2) In 2.3.1 - it says "..we will turn off the RGB LED of Picobricks, if not, we will turn off the LED". I believe it should say "if not, we will turn ON the LED".

3) In project 2.2.5, why aren't "When Started" and "Forever" blocks required? Using only two "When" blocks seems to keep the code running forever. Confusing... In a later example it did mention that "When" blocks run all the time. It would be helpful to mention this earlier to avoid confusion...


Suggestions:

1) Using Micro Blocks program on my iMac, I do not see any way to quickly clear the work area of all code blocks. One can right-click on individual code block objects and choose Delete. BUT how do we quickly delete all code to start with a blank workspace? I'm guessing Micro Blocks is provided by a third party?

2) It would be really helpful if references to code block names were italicized (or bold). e.g. "When Started" could simply show as When Started...


LOVE the product so far!! Nice work!

-Mike

Comments

  • Hi,

    The best way at the moment is to go to the file menu and choose new.

    MicroBlocks is made by this team of developers https://microblocks.fun/about#team

  • @ReedMikel

    thank you for your comments and suggestions.

    • Re: when started and forever loop use

    MicroBlocks is a real-time event driven environment. As such, it is more appropriate to utilize event-driven code than the old style of "start and loop forever checking for conditions" paradigm. Event-driven coding is generally not available in other coding environments and we wanted to introduce it to the beginners. This style of coding also allows for more simplified, per event logic to be written and independently debugged.

    Unfortunately, coding styles imposed by environments like Arduino IDE go counter to this and may create a confusion. However, in the long run, this approach will better serve the beginners.

    • Re: block name highlighting in code descriptions:

    italicized (or bold) is a good idea and we will review the examples and implement it.

    • Re: Starting with a blank coding area:

    As @PeterMathijssen mentioned, File/New will get you a clean slate. Also, if you are not familiar with the MicroBlocks environment and coding practices, please take a look at our Web Pages and the WIKI for numerous pointers and information.

    Web: http://microblocks.fun/

    WIKI: https://wiki.microblocks.fun/

    • Re: Micro Blocks is provided by a third party?

    MicroBlocks is a creation of John Maloney, who has been in the forefront of the block-based coding paradigm for several decades, in cooperation with a group of people who believe that "We should aim to make MicroBlocks the most intuitive and engaging tool for physical computing imaginable, and to create a global community of learners and educators around it." We are proud of what it represents and offers in terms of expressing the best ways of handling physical and real-time problem solving.

    Enjoy MicroBlocks and welcome to the fold.

  • Thanks to both of you! I did discover the File->New option on menu bar shortly after posting :)

    Turgut - as far as MicroBlocks being an event driven environment: I did a lot of assembly language CPU/micro-controller coding about 40 years ago (Z80, 8085, 6502 etc). This event driven environment almost sounds like an interrupt handler that I would have written to handle various scenarios (e.g. a pin going high or low, a UART having received a byte of data etc). So the Wait command block seems to parallel a simple interrupt driven event handler that I would have coded (decades ago :) ) This type of event driven coding is indeed a very powerful and effective way of coding! The alternative is what I'd call a polling scenario - where one's code is in a Forever loop and continually checking for various conditions (same examples - pin going high/low, UART data etc). Decades ago, speed/efficiency of one's code was paramount - so interrupt/event driven code was crucial in some applications. I imagine with the blazing speed of today's chips that code doesn't necessarily need to be super efficient...

  • In 2.5.1 (Graphic Monitor), it correctly states "In this project, we will prepare a project in which we increase or decrease the brightness of the red LED with a potentiometer."

    BUT in 2.5.4 it incorrectly states "As you turn the potentiometer, you can prepare a project that changes the volume of the sound coming out of the buzzer and displays the flowing data on the graphic monitor"

    2.5.4 should be corrected to state this project will affect the LED brightness, not sound...

    Also, the code should probably be tweaked to draw the graph of the potentiometer's value as a percentage (0 to 100%), as opposed to the raw pot value (0 to 1024). The reason is because the graph window, even when stretched to max height, does not have enough room to show higher values (e.g. max Y value on graph on my iMac is +650, min Y is -650). Or, maybe there's a way to pass max and min Y ranges for the graph block?

    I modified code as shown below to graph a 0 to 100 percentage:


  • You could also use the rescale block that I explained here to rescale the potentiometer.

    https://community.robotistan.com/index.php?p=/discussion/50/little-tip-control-your-servo-with-your-potentiometer#latest

    You could rescale from 0-1023 to 0-100.

  • ReedMikel
    edited November 2022

    That Rescale block does sound like it would be helpful. Unfortunately, Rescale does not show under the Operators->Advanced section. And yes, I do have the Settings->Show Advanced Blocks turned on. I am using the latest standalone MicroBlocks program (not web-based MB) on my iMac. I wonder if there is some other setting I need to tweak?

    Here's what shows under Operators using the MB standalone program on Mac:


  • Going back a few posts: While File->New does indeed clear the workspace of all code blocks, it also clears the loaded Libraries. Is there a way to avoid the Libraries being cleared? Or, can one set default Libraries to load every time?

  • So to be clear, which version of MicroBlocks are you using?

    If you go to the gear menu and choose about.... do you see the below information dialog?

    Did you get the latest Pilot version?

    https://microblocks.fun/downloads/pilot/packages/

  • "While File->New does indeed clear the workspace of all code blocks, it also clears the loaded Libraries. Is there a way to avoid the Libraries being cleared? Or, can one set default Libraries to load every time?"


    You could make an "empty" file with the libraries you need and use that as a starting point for new projects.

  • @ReedMikel

    Selected Library Load can be accomplished by saving an empty project with the desired libraries loaded. Then instead of doing a NEW which cleans out everything, just reload the template project with your desired libraries.

    Version 1.1.85 of the pilot contains the rescale block under the operators:


  • @PeterMathijssen

    Sorry Peter, by the time I submitted my response, you had already posted your excellent answer.

    Internet is slow in my village ! 😎

  • It's fine. I was already glad we gave the same answers 😁

  • @PeterMathijssen My standalone MicroBlocks on my iMac shows version as 1.1.61 (Firmware v155). I got everything off the site the other day by following the instructions in this e-book (first went to web version, then chose download and it pointed to a Mac version of MicroBlocks)... Could it be that there are no Mac versions at the link https://microblocks.fun/downloads/pilot/packages/standalone ? The parent folder you referenced looks like it might only have Windows stuff? Though I'm not familiar with the ublocks--xxx.deb files.

  • @PeterMathijssen - also, what does "Pilot" version mean? Beta? Or?

  • PeterMathijssen
    edited November 2022

    Hi,

    Like @Turgut said. The rescale block is in version 1.1.85 of MicroBlocks. So you should download this file and extract it

    https://microblocks.fun/downloads/pilot/packages/MicroBlocks.app.zip

  • ReedMikel
    edited November 2022

    Oh, maybe the ".app" in the file name implies Mac - I'll try it...

    Update: just downloaded MicroBlocks.app.zip and extracted the Mac app file - now my version shows as 1.1.85 and Rescale code block lists under Operators->Advanced :) Thanks!!

  • "If you want a preview of upcoming features, you can try out the Pilot Version, but keep in mind it might not be as stable as the main release."

    This is from the text above the Pilot version button. It says it all. 😁

    I always use the latest Pilot because it gives me the latest features.

  • Ahhh, so "pilot" = "beta" - thanks. Just never heard of that verbiage...

  • I like the name Pilot better. 😁Beta implies in my view the focus on risks for unstable behavior. Never lost any project or code when using MicroBlocks. Off course with any software it can have and has bugs but they are fixed very fast. Thats why I always use the pilot.

  • ReedMikel
    edited November 2022

    Sample 2.11 - on the first page (93), it mistakenly lists the first 2 paragraphs/sections as 12.12.1 and 12.12.2. It should read 12.11.1 and 12.11.2.

  • ReedMikel
    edited November 2022

    Sample 2.11 - the wiring diagram on pg 93 (section name is incorrectly listed as 2.12.2 - see prior post above), seems to be incorrect IMO. I have attached an enlargement of the wiring diagram from pg 93 below. Notice the blue wire is shown connected to the 3rd pin down from upper left corner of Pi Pico chip. On my PB board, the silkscreen labels that 3rd pin down as GND (Ground). The BLACK wire should be shown connected to GND, not blue wire. And the black wire is mistakenly shown connected to the 4th pin down, which is labeled GP2 on my PB board. I believe GP2 is not even used in the code. Instead, the blue wire should be connected to GP1, which is the 2nd pin down (from upper left corner). It looks like the red wire is drawn correctly - connecting to the 5th pin down from upper RIGHT. This pin is labeled 3V3 in my PB board...

    Also - the MicroBlocks code shown (2.11.5, pgs 94-95) does not seem to match the project's description. I see no code block that turns the relay on or off. Just the LED gets toggled...

    Lastly - 2.11.5 states "The digital sound sensor sends us a value of “0” when sound is detected through the digital pin it is connected to, and “1” when idle." The MicroBlocks code, and my observation, indicates that the reverse is true: sensor sends a value of "1" when sound detected, "0" when idle.

    Note: initially I thought I would need 3 Male-Female jumper wires to connect the sound sensor's 3 pins as shown in diagram. But I then saw the actual photo of this project (pg 94) where they used a 4 pin Easy Connector F-F cable in combination with 3 M-M individual jumper wires to make the connection.

    I am guessing no PB staff has had the time to proofread this e-book Projects manual, building the sample projects etc?


  • @ReedMikel

    I am reviewing all the projects this week and next. Robotistan team is new to the MicroBlocks and there have been some errors. But we'll get them all corrected. Appreciate the edits provided.

  • @Turgut - can you tell me where to find the library(s) for the ESP8266 WiFi module for use with MicroBlocks? Sample 25 shows some WiFi code blocks that begin with "ESP01_", but I can't figure out how to access/find those ESP code blocks... Tks!

  • @ReedMikel

    One more time: they are in the Custom Blocks menu of the Project #25.

    Also see your RTC posting for a more detailed explanation.

    And please do not split same posting topics across multiple postings. It is hard to answer and hard to follow.

  • @Turgut So sorry - I am totally new to your community website, PicoBricks etc. I did not see any mention of Custom Blocks until your post just now. Perhaps I missed an email notification - again, sorry for the inconvenience... I have spent a good deal of my time finding these errors for you...

  • @ReedMikel

    Nothing to be sorry about! All is good.

    We are all newbie's at one thing or another, and let's grow together.

    Your error corrections are much appreciated and I am revising the instructions / description for the Example Projects. Soon there will be hopefully a better version out.

  • kayakbabe
    edited December 2022

    not to change the topic flow, but I read your ReedMikel November 12. it hit me very hard. I too started coding like you did with assembler, machine, and some of the early languages. Today I am CIO of a ecommerce based retail company. Code efficiency is sadly not taught today to coders and not even really encouraged or applauded. I have to teach it to my new developers and hammer them on it. The excuse I hear over and over is "but, it works". "but it works" isn't good enough. I even started an office trophy to pass from desk to desk to whomever did the best optimization for their code. They really don't get it until one of them gets fired. I or one of my senior team members gets the fun task of figuring out what code is causing the cpu cycles to go crazy and is making us have to plug in another server. (yeah icloud spin one up etc. whatever. it all costs money) Efficiency really does still matter if someone is going to get the big high paying job. I have an ecommerce based company and rather than throwing more and more servers in more and more complicated redundant arrays at a website that is super busy doing lots of transactions, I want efficient code. Paying a great coder up front for efficient code makes a huge difference over the expense of servers and hosting them. Compare the cost over an entire year and, wow!, a great efficient coder for a business like mine is worth the higher salary.


    I think the loss of efficient code as a goal in coding is detrimental to advancing computer science.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!