Controlling my Ranger using Python


#1

I purchased my Ranger solely to program it with Python, having read
“With mBlock 5, users can easily switch to Python[1]coding with only one-click. After users grasp how to program with blocks, they can effortlessly move on to Python. No need to switch between software because mBlock 5 allows writing code directly in its Python editor. The transition is seamless.”
Unfortunately you fail to mention that we can only control sprites from Python and that we will still need to use C to manage the device, i.e. ranger. Is there any way around this as I am not interested in learning C.
Regards
Robin


#2

Short of creating Python wrappers around the official Makeblock libraries or rolling your own from existing Python libraries for Arduino, I’m unaware of any other way to do that. FWIW, the Ranger uses the Mega2560 as the basis of its control board. :frowning:


#3

OK, i thought that might be where i was headed.
How hard will it be to use the standard arduino libraries to control the ranger?
Presumably they just provide access to potentiometers and steppers etc via a number.
Robin


#4

If you look at the official Makeblock libraries (link), you’ll note that in some cases they use existing Arduino libraries. The biggest thing you’ll need to account for is the way that the pins are assigned to the DuPont plugs. Here is a link to the Makeblock info for the Auriga board that may prove helpful in beginning to suss out that information.

@tech_support, is there a table available that lists the pins assigned to each DuPont jack?


#5

Hello RobinGJ:
I had a similar problem in that I purchased Starter and Ultimate that are not supported in mblock 5. I also wanted to program i python.

You can see my posting here:
https://forum.makeblock.com/t/me-shield-for-raspberry-pi-makeblock/13588

You can have a solution for about $20USD. I started with a Raspberry PI 3, but now have it working with a Raspberry PI Zero WH (wireless with headers). The makeblock (arduino) supplies the power to the PI thru the shield and also the communications between the two boards.

Since the PI has wifi and a full operating system, I can talk/program it from my PC/tablet with python thru a free (VNC) remote desktop software.

ALLIE (my makeblock-PI robot) has worked with all the makeblock sensors that I have tried so far.