RoboticsGeneral

Maqueen and Python

userHead assimacos 2021-03-09 03:23:22 1677 Views2 Replies
Hello,

I am trying to use Maqueen (v3) with python but i am having some issues.
I can control the grey-scale sensors (pins 13 & 14) and the red leds (pins 8 & 12).
Issue 1
I have failed completely to control the RGB leds (pin 15) with python. I have used the code suggested in the maqueen library supplied by gilles.teisseire1 in this forum in the thread "I WANT TO USE PYTHON CODE TO CONTROL MAQUEEN.", which uses the same code as the one in the neopixel examples on the microbit site. I have tried with the Mu editor, the online editor from the microbit site and the mind+ software. The only time that the RGB leds worked was when used with the makecode editor (so I know they are not faulty).

Issue 2
The motors can be controlled with makecode. I can also control them by issuing the following command in the REPL:
Code: Select all
i2c.write(0x10, bytearray([0, 0, 255, 0, 255]))
for both motors forward at max speed.
They stop or turn backwards or perform successfully any other combination of the last four elements of the byte array. So again we have proof the they are not faulty.
When I try to use the same command in code flashed to the microbit I get an "OSError: 19". This is true for both the Mu editor and the online editor.
I also tried the example for motor control in the Mind+ software. This failed also with the number 529 scrolling on the LED display.

I have not yet tested the ultrasonic sensor HC-SR04

The above results have been tried in the following configurations:
1. Raspberry Pi 400 with
- Mu editor (stock)
- online python editor
- MakeCode editor
2. Windows 10 with
- Mu editor (in maqueen mode, downloaded from github, as suggested in another thread on this forum)
- Mind+ software
The Maqueen is powered with 3xAAA batteries

My goal is to control the robot in python written on the Raspberry Pi.
Thank you, in advance, for your answer.

Antonis Assimacos
2021-03-11 03:57:35 Sorry, I do not understand your answer.
My microbit is v2.
I flush python code to the microbit.
Are you referring to the MicroPython version of the microbit? How can I find the correct version?
Thank you for your answer,
Antonis Assimacos
userHeadPic assimacos
2021-03-10 15:11:13 You need to check the version of your micro:bit. If you use the V1 version of the code to burn to the V2 version of the board, an error will be reported. userHeadPic 347945801