antonvh / mpy-robot-tools

Install on a SPIKE Legacy or LEGO MINDSTORMS Robot Inventor hub for easy Bluetooth communication, animation, and motor synchronization.
https://antonsmindstorms.com
GNU General Public License v3.0
35 stars 11 forks source link

bluepadtest #15

Open sspoto opened 1 year ago

sspoto commented 1 year ago

https://github.com/antonvh/mpy-robot-tools/blob/master/Example%20projects/bluepad_test.py

Doesnt appear to be working for me. I am following the steps at https://antonsmindstorms.com/2022/03/22/python-ps4-gamepad-connection-robot-inventor-and-spike-prime-hub/.

And when it came to test the gamepad. I get the following error: Traceback (most recent call last): File "programrunner/init.py", line 1, in start_program File "init.mpy", line 10ImportError: no module named 'projects.mpy_robot_tools.mshub'

The console from the install of the mpy files is the following: [19:59:23.189] > Hash generated: f8ed79b7a3ac2517af0269b044b269af98a3d1585c79b9726fbdcfde424fcdfd

[19:59:23.217] > Writing file helpers.mpy

[19:59:23.277] > writing helpers.mpy to folder /projects/mpy_robot_tools

[19:59:23.442] > Finished writing helpers.mpy, Checking hash.

[19:59:23.481] > Hash generated: 7174067aa52f5ca8e575eb9fe7518227a7ab93c4eaeae52a8e4a3b3aabfd6908

[19:59:23.504] > Writing file serialtalk

[19:59:23.570] > Writing file serialtalk/init.mpy

[19:59:23.604] > writing serialtalk/init.mpy to folder /projects/mpy_robot_tools

[19:59:23.739] > Finished writing serialtalk/init.mpy, Checking hash.

[19:59:23.807] > Hash generated: 9f2caf23a8ab6961a6149dcf286cf1a6e5675a2634de84f53432a514dd72cf32

[19:59:23.846] > Writing file serialtalk/mshub.mpy

[19:59:23.892] > writing serialtalk/mshub.mpy to folder /projects/mpy_robot_tools

[19:59:24.031] > Finished writing serialtalk/mshub.mpy, Checking hash.

[19:59:24.098] > Hash generated: cba9815b037de93164b881430c323f5cd82b5a68645d988ba77829c1bf193576

[19:59:24.138] > Writing file serialtalk/serialtalk.mpy

[19:59:24.180] > writing serialtalk/serialtalk.mpy to folder /projects/mpy_robot_tools

[19:59:24.358] > Finished writing serialtalk/serialtalk.mpy, Checking hash.

[19:59:24.482] > Hash generated: 6c818007ffa05939bf6e7da3baf470efc158c6e5ce923cebb9f0fec9c0fae6f5

Note: I didnt flash it as, I believe its flashed before it arrived. @antonvh

sspoto commented 1 year ago

The following code will run! I am so excited ;) from projects.mpy_robot_tools.serialtalk import mshub ur = SerialTalk( mshub.MSHubSerial('A'), timeout=20) I used the following tutorial to verify modules:https://primelessons.org/en/ProgrammingLessons/MicroPythonIntro.pdf

antonvh commented 1 year ago

So it works now? Can I close it?

sspoto commented 1 year ago

Yeah I cant explain, why but for me the package differed a little. Feel free to close or make a change. Thanks for all your work!