Skip to content

missing pyb import when run test #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CharlesCCC opened this issue Sep 17, 2016 · 5 comments
Closed

missing pyb import when run test #4

CharlesCCC opened this issue Sep 17, 2016 · 5 comments

Comments

@CharlesCCC
Copy link

missing pyb import when run test code.

@peterhinch
Copy link
Contributor

The pyb module is specific to the Pyboard. These drivers were developed for this platform.

If you are running the code on a Pyboard, what is the exact error message you are seeing? Otherwise please let us know your platform - we might consider doing a port.

@CharlesCCC
Copy link
Author

@peterhinch Got you. That make sense now. Sorry, my bad, I was trying to use it for the Raspberry Pi. I don't know if this is another platform that you would like to support. Appreciated you guys' work.

@peterhinch
Copy link
Contributor

I have no plans to support the Pi: my interest is in platforms running MicroPython on bare metal. Unless @turbinenreiter has such intentions you may need to look elsewhere, or DIY. It shouldn't be too difficult, but you'd need to study and compare the Pi's I/O with that of the Pyboard.

@turbinenreiter
Copy link
Member

turbinenreiter commented Sep 19, 2016

@CharlesCCC
Step 1: Change the whole driver to take an I2C object as argument instead of creating it itself in imu.py, mpu9150 and mpu9250.py.
Step 2: In imu.py change the _read and _write methods to whatever your platforms equivalent of the contained commands are.
Step 3: Send a pull request.

This should really be straightforward.
Find the RPi I2C doc here: http://www.raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2

Step 1 is something I wanted to do for the longest time, but I switched to using the BMX055 and therefore this is quite low on my list.

@peterhinch
Copy link
Contributor

@turbinenreiter the driver can already take an I2C object as an argument. We implemented this on 19th March this year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants