Section 2.4 - Thermometer: Only works when connected to computer.

I just started doing some of the PB examples in the e-book. I did section 2.4 (thermometer), even modified it to display degrees F instead of C. Works fine while connected to my iMac and using the MicroBlocks program (not using web version). The problem is when I disconnect the micro USB cable from my computer and plug it into a USB power adapter. The program does not run (nothing displays on OLED). The red power LED lights up and stays on, the green LED turns on only for about 1 second.

Before unplugging the USB cable, I click on the STOP button in MicroBlocks program. Then I click on the USB tool/button and choose DISCONNECT. Maybe there is some other instructions that need to be followed to run the PB board on an external USB power supply?

I think I'll try one of the simpler LED sample programs and see if that works when I switch to external power...

Comments

  • Sample 2.1 - the flashing LED works fine when board is plugged into external USB power supply. So there's some issue with the OLED not working in a standalone mode...

  • There is a delay issue with the initialization of the temp/humidity sensor. It's fixed when using the web, but must not be updated on the download yet. Add in extra wait blocks like in the image.

    For more info, check out Turgut's post on Nov 4 in the 'Temperature sensor not working' thread.

  • This was fixed in the latest Pilot version 1.1.84-pilot of MicroBlocks released on November 7th.

    You can get that here https://microblocks.fun/downloads/pilot/

  • Before seeing these, replies I had thought I would try adding a delay at start of my code. Adding a short 1 sec delay did the trick :)


  • Is there a more efficient way to do my degrees C to F conversion? Formula is TempF = (TempC * 1.8) + 32. I found I could only use whole numbers, so handled the 1.8 multiplier in two steps. Could the conversion all be done in one line/block?

  • You can nest blocks.

  • ReedMikel
    edited November 2022

    You can get that here https://microblocks.fun/downloads/pilot/

    Just looked at the above link: the standalone subfolder lists some linux and Win files dated 11/12 (today). Where would I find the standalone file for MacOS?

    Tks!

  • PeterMathijssen
    edited November 2022

    You should use this file https://microblocks.fun/downloads/pilot/packages/MicroBlocks.app.zip as far as I know. I don't have a Mac so can not help you with that.

  • For newbies that want to see the temp in degrees F, my streamlined code (thanks Peter) looks like below. Note - you do have to create the variable TempF in MicroBlocks by going to Variables->[Add a variable] ...


  • You don't even need a variable to make it work 😉


  • True, but I wanted to test creating variables. Could come in handy to have the temp saved as a variable. Anyways, good to know :)

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!