Block based programming on Raspberry Pi Pico with BIPES

Create block based programs for Raspberry Pi Pico in minutes!

About one year ago, we created BIPES Project – Block Based Integrated Platform for Embedded Systems (http://www.bipes.net.br), specially focused on integrating Blockly and MicroPython with a direct connection from the web browser to the development boards – initially for ESP8266 and ESP32.

With more than 500 different users currently using BIPES (according with Google Analytics), it has several interesting features, such as the possibility of programming embedded devices without the need of installing absolutely no software or plugin. Simply access BIPES website, connect the blocks, connect to the board and get the program running. A USB/Serial/WebREPL console/terminal is integrated in the webpage, allowing direct access to serial devices.

We have now created some blocks on BIPES specifically for Raspberry Pi Pico.

It’s simple and easy to use:
(Tested / working on Google Chrome)

0. Get a Raspberry Pi Pico board with MicroPython loaded. If you still did not load MicroPython on your RPI Pico, it is as easy as copying a file to a thumb drive. Details here:
https://www.raspberrypi.org/documentation/rp2040/getting-started/

1. On Google Chrome, enable the option “Experimental Web Platform features ” (see figure). To enable the option, go to the URL: chrome://flags and activate the web platform features. This option will allow Google Chrome to directly access the USB devices connected to the serial port, without the need of additional softwares. This action must be done only once.

bipes chrome experimental features

2. Go to https://bipes.net.br/beta2serial/ui/

3. On the target device box, select “Raspberry Pi Pico”

4. Go to the Console tab and click “Connect”.
type Enter one or twice, to check if the board is responding. If everything is ok, you should get a MicroPython prompt (>>>). Now you can interact directly with the board from the web browser!

5. Go to the blocks tab and build your program. Then simply click on the “Run” button, and your program blocks program will be translated into Python and executed!

That’s all!

If you want, you can directly share the programs you created by sending a link to your program, by clicking on the link button. Here are some working block based examples:
(just click on the link and you will open the working program)

1. Blink built in LED
https://bipes.net.br/beta2serial/ui/#zpqb8c

bipes rpi pico example1

2. Blink built in LED with different approach
https://bipes.net.br/beta2serial/ui/#xygodb

bipes rpi pico example2

3. Fading built in LED with PWM
https://bipes.net.br/beta2serial/ui/#7piqwf

bipes rpi pico example3

4. Read GPIO Input
https://bipes.net.br/beta2serial/ui/#24n7a7

bipes rpi pico example4

5. Read ADC Input (raw values)
https://bipes.net.br/beta2serial/ui/#9uxi5c

bipes rpi pico example5

6. Temperature sensor
https://bipes.net.br/beta2serial/ui/#vu8w2q

bipes rpi pico example6

Demonstration video (english):

Demonstration video (portuguese):
https://www.youtube.com/watch?v=er4cQtDe5qU

Note: BIPES also supports creating, editing, running and managing text files on MicroPython based boards, such as Python scripts. This feature is fully functional for WebSocket / Wifi connections with ESP32 and ESP8266. However, such feature is still incomplete for USB based connection, but will be working soon.

BIPES Source code is available on github:

Main (WebSockets / Wifi)
https://github.com/rafaelaroca/BIPES_ui_testing

USB Version
https://github.com/rafaelaroca/bipes_serial

This entry was posted in Uncategorized. Bookmark the permalink.

19 Responses to Block based programming on Raspberry Pi Pico with BIPES

  1. Pingback: Block Based Coding Comes To the Raspberry Pi Pico - Moloft

  2. Pingback: Block Based Coding Comes To the Raspberry Pi Pico - The Designer News

  3. Pingback: Block Based Coding Comes To the Raspberry Pi Pico | Tom's Hardware - INFOSHRI

  4. Pingback: Block Based Coding Comes To the Raspberry Pi Pico - NewsDay24.com

  5. Pingback: EasyMQTT with BIPES and ESP8266 – Quick demonstration | Yet Another Technology Blog

  6. Pingback: BIPES apporte la programmation Visual MicroPython basée sur des blocs au Raspberry Pi Pico, RP2040 | WeMenus

  7. Rudolf Schenke says:

    I have a problem with Raspberry Pi Pico with blocks:
    – Created a variable with block “set to 1” -> OK
    – Adding a block “change by 1”: In python is a line added “from numbers import Number”
    – Running gives the error “ImportError: no module named ‘numbers’.
    Thats true, there is no module named ‘numbers’ in MicroPython.

    • Rafael Aroca says:

      Hi Rudolf, thanks for trying BIPES and sorry for the error. Could you please share the blocks you made using the button that shares the program as a link? In fact, there is no module numbers in MicroPython, but we will try to fix it. Anyway, could you please share the blocks with the error by posting the URL to the program here?

      thanks!

  8. Rudolf Schenke says:

    Hello Rafael, fast response – many thanks!!
    You find my very simple program at
    http://bipes.net.br/beta2/ui/#qnrnyn
    The behaviour is like described. I hope, this is a small correction…
    With regards, Rudolf.

    • Rafael Aroca says:

      Hi Rudolf! Thanks again for the interest. Could you please try again? I have made a few modifications, and “change by” block should generate a different code now.

      best regards!
      Rafael

  9. Rudolf Schenke says:

    Hi Rafael, Unfortunately, I cannot continue because the program is behaving strangely.
    – I set the program to “USB / Serial” and “Raspbery Pi Pico”
    – Then comes my traffic light program that I built yesterday
    – I load the example “… # qnrnyn” that I published (with the problem)
    – The program shows again “ESP8266 (NodeMCU) for device.
    – I switch back to “USB / Serial”, then my traffic light program is back.
    So it is not possible for me to load a program from “Shared”.
    Furthermore: I added a variable to my traffic light program and added a “Change …” block to the program, the same effect: “from numbers import Number”.
    So now I see 2 problems …
    About my background: I am an instructor in our Technic Club, where children and young people learn to program. So far we have programmed a lot with Scratch. Bipes would be a good addition to expand with controllers.
    With regards, Rudolf.

    • Rafael Aroca says:

      Hi Rudolf, sorry for the delay!

      You found some bugs, sorry! Thanks for pointing them out. Hope to fix them soon.

      But there are workarounds that you can use, if you could try:

      First, the link you shared:

      http://bipes.net.br/beta2/ui/#qnrnyn

      is different than:

      http://bipes.net.br/beta2serial/ui/#qnrnyn

      Because /beta2 implements functions to talk to ESP8266 and other using wifi / WebREPL protocolo and not USB. So, for Raspberry Pi Pico, we must use:

      http://bipes.net.br/beta2serial/ui/#qnrnyn

      Second bug you found (sorry again), is that when a shared link is opened in beta2serial, USB stops working. There is no problem for wifi connection, but it causes a failure with USB.

      I made some tests, and as a workaround, I would kindly suggest / ask you to proceed as follows:

      1. Load your shared program:
      http://bipes.net.br/beta2serial/ui/#qnrnyn

      2. Click on Save Icon, and you will save XML file with the program. You can always save the program to a local file.

      3. Close the browser window and open again directly to:
      http://bipes.net.br/beta2serial/ui/#qnrnyn

      5. If older blocks appear, click on the trash button to clean the workspace.

      5. Select Raspberry Pi Pico in the combo box selection box

      6. Click in the load XML icon (a disk with an arrow) and select the recently saved XML file

      7. Connect and run your program 🙂

      Again, sorry for the bugs. As you know, BIPES is a beta software, and you are helping us getting it better. Hope we can fix these issues soon, but these workaround should help by now.

      PS.: Fixed import numbers to for the block “change by”

      best regards!

  10. Pingback: BIPES: Visual development environment for Raspberry Pi, ESP32 & Co. | Marijuanapy The World News

  11. Teare says:

    Hello,
    I tried to use the OLED block and the resulted code is
    I2C(-1, SCL=,….)
    so I get an error saying this is an error. Shouldn’t it be a 0 by default. In fact I think it is the I2C number which could be 0 or 1
    What do you think ?

    • Rafael Aroca says:

      Hi! Thanks for the report, and sorry. Funny how MicroPython handles it. For ESP32 and ESP8266, the correct option is -1 while for RPI Pico is 0. We will need to add an IF to BIPES code generator. Hope we implement this soon. Sorry for the error.

      best regards

      Rafael

      • Teare says:

        In fact depending on the GPIO you choose for sda/scl the value is 0 or 1 – FOr GPIO 8-9 or 16-17 it is 0, for 6-7 or 18-19 I2C id is 1 !
        Thanks for your prompt response

      • Rafael Aroca says:

        Hi Teare! Just updated BIPES (serial version: https://bipes.net.br/beta2serial/ui/) adding the option of selecting the I2C port as one input of the OLED Init block. Could you please check if it solves the issue / helps? Depending on your setup, you might need to force reloading BIPES webpage with Ctrl+F5 or Shift+F5.

        Please, let us know if it works. Best regards!

  12. Teare says:

    SOunds great – I could use OLED display on GPIO 16-17
    Thanks a lot

  13. Teare says:

    Sorry to disturb again but I have another question :
    I tried to use the Character DISPLAY – It says to install the I2C_LCD.py library but when I try to run the python code shows:
    from esp8266_I2c_lcd import I2cLcd

    module not found : esp8266_I2c_lcd
    So 1) it is the good library and include ?
    if yes, sounds like import library didn’t work (I don’t see anything on console)
    If I transfer library locally and I go to FILES and try to upload to device It stays there forever. How can I debug that to see what’s going on ?
    Thanks and Best regards

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s