Is it possible to make a Raspberry Pi Pico device for makeblock?


#1

Hello there,
I want to prepare Raspberry Pi Pico as a device with Micropython. Does this micro-processor card support Makeblock Extension Builder?


#2

Hi, I’m reviving this old thread. But is there any progress made on this? Would like to work on this too


#3

Yes @nigel @MeKAnick it is possible to do so. mBot Neo is actually a python programming board, so you can see some of my screenshots of its code:

image

If you need more help with a specific part let me know.


Write extension For Raspbery Pi Pico RP2040
#4

Hi @Best_codes, @nigel

I tried it 2 years ago and it didn’t work. Makeblock engineers said that they did not have any work for the RP2040 chip. Later, I tried to add another ESP32-based circuit board called “Deneyap Kart” as a device. Even though I added all the details, the connection was established but the code was not loaded. I don’t know if there has been an update on the Platform since then.


#5

If you have a chip with these specifications, you can use it:

You can download the cyberpi device and import to extension viewer to look at it if you want.


#6

These are the specs


#7

MrYsLab has an extension for Raspberry Pi Pico so I reckon its possible to implement in mBlobk too.


#8

Yes, it is possible. I can give you the link to download one of the python ESP or PI mBlock device .mext files, so you can look at it in the extension builder if you want to make a new device for it.


#9

Hi @Best_codes sure that would be great!


#10

I studied and applied this work. First of all, changes have been made to the Scratch editor. It’s not the original MIT published app. In addition, some APIs need to be installed on the computer. In addition, Pico’s frimware software needs to be updated. As a result, basic pin commands can be used when Pico and Scratch are connected. There is no ability to install code on Pico. I think it’s a very challenging process.


#11

Shouldn’t we install the frimware of Codey, Cyber Pi, Halocode products on our Card to be able to encode any card that uses the ESP32 WROWER-B chip in mBlock?


#12

@nigel @MeKAnick Here is the link:

https://ext-eu-res.makeblock.com/prod/cyberpi_v1.1.28_8437a059.mext

You can download the file and import it into the extension builder to see the code.
I hope this helps!


#13

thank you


#14

thanks.


#15

No problem!


#16

I am attempting to create a Pico device, but when I import the CyberPi file you provided here and see how the CyberPi was implemented, it looks like there needs to be code on the cloud to support the Pico.

For example, the block labeled “when CyberPi starts up” uses an include of cyberpi as well as the Live Mode Handler shows the following code:

async (args, app, device, block) => {
let ret = false;
if (this.cyberpi_launch) {
ret = true;
}
await commonFunction.delay(200);
this.cyberpi_launch_flag = false;
return true;
}

Am I correct that additional code is needed on the cloud side before a Pico device can be added?


#17

No, @sk8board, no additional code should be needed on the cloud side. Here’s an example code for a Pi Pico:

from machine import Pin
import time

led = Pin(25, Pin.OUT)

while True:
    led.toggle()
    time.sleep(1)

This code uses the machine module to control the GPIO pins on the Pi Pico. It sets up Pin 25 as an output pin, which will be connected to an LED. The toggle() method is used to alternate the LED's state between ON and OFF every second. The time.sleep(1) function pauses the execution for one second before the loop repeats.

When you run this code on the Pi Pico, it will make the connected LED blink on and off every second.

Please note that to run this code on your Pi Pico, you need to have the MicroPython firmware installed on it.

So, in order to use the above code, we simply need to upload the machine library to our device. To do this, I believe (don’t quote me on this) that we would add the machine library (a .bin file, most likely) here:


and in our block:

Something like that. I’m not sure, because I haven’t done much MicroPython, but something like that. Making a device is a lot of work!

Good luck.


#18

Thank you for the quick response.

I am familiar with MicroPython and the Pico, but when I see the items highlighted with arrows below in the block labeled “when CyberPi starts up”, I suspect some include files and some functions that are being called are using code that is on the cloud.

Are you certain that code is not needed on the cloud for the cloud to interact with the MicroPython bin file when using live mode, sending code to the Pico, pressing the green flag button, as well as other mblock UI buttons?


#19

@sk8board If by ‘Cloud’ you mean that CyberPi would require an Internet connection to get functions, then no, it does not (except for speech recognition, weather, and text to speech). If you mean that it requires the cyberpi library, it does, but it is built in to makeblock.


#20

If you mean that it requires the cyberpi library, it does, but it is built in to makeblock.

Yes, that is what I mean. If the cyberpi needs a library from makeblock, then would the Pico also need a library from makeblock? How does the Pico interreact with the mblock UI while running in Live Mode without a library from makeblock software?

Also, a Pico or an ESP32 can be used with MicroPython or CircuitPython depending on the binary that is used on the Pico or ESP32. Since the cyberpi uses an ESP32, does mblock use MicroPython, CircuitPython, or a custom variant by makeblock?

I have to believe that makeblock software would need some code for the Pico to support all functions in mblock including live mode. Is there any documentation of how to get a device to use mblock functionality?

Thank you for your support.