Page 1 of 1

SenseHAT with PyBoard

Posted: Wed Mar 23, 2016 10:25 pm
by marfis
Uses the Custom interface board (described http://forum.micropython.org/viewtopic.php?f=5&t=1268) to connect a Pyboard with a SenseHAT board (https://www.raspberrypi.org/products/sense-hat/).

But you can of course also manually wire the I2C bus, 3V3 and 5V to the SenseHat and avoid the interface board.

The SenseHAT contains a lot of sensors, so most of the work was to write drivers for the LED matrix, joystick, pressure, humidity, and temperature sensors... see an example of displaying all those values on the LED matrix:
https://www.youtube.com/watch?v=PeZRtHPF3iU

And lastly the 9 DOF (gyro/accel/magnetometer) IMU sensor which was the most complex one.

Using @pythoncoders fusion.py I was able to calcualte the pitch, roll, yaw angles. I show a simple example of this in the video
https://www.youtube.com/watch?v=LYzvXsxPtbw.

Here goes a big thanks to @pythoncoder - using the fusion algorithm worked without problems!

All the code used can be found on my github page:
https://github.com/hoihu/projects/tree/master/raspi-hat

Re: SenseHAT with PyBoard

Posted: Thu Aug 17, 2017 9:22 pm
by marfis
I updated this with a fritzing wiring diagram:
https://github.com/hoihu/projects/blob/ ... ard_bb.png

5 wires are necessary to connect a SenseHAT to a pyboard.

I updated the hts221 and lps25 drivers to work with the machine API and tried to make them as compatible as possible to the proposal in https://github.com/micropython/micropython/issues/2093. Both drivers support fixed and floating point platforms.

The gyro sensor LSM9DS1 driver was only marginally updated (so that it works with the machine API, but not including any of the features of the sensor API).

Note that for correct fixed point support you'll need a fairly recent version of uPy because there was a bug when negative powers and big-ints were used: https://github.com/micropython/micropython/issues/3237

One driver is a pending pull request and discussion base for the sensor API:
https://github.com/micropython/micropython/pull/3256

feel free to comment there.

Re: SenseHAT with PyBoard

Posted: Thu Aug 17, 2017 9:39 pm
by marfis
Just for the sake of completness:

I thought I could use the frambuf module for the 8x8 LED display. But no luck - each pixel occupies 3 byte of color data (24 bit RGB mapping) and that is apparently not yet supported by the framebuf module.

Would that be a useful addition? I guess there must be other displays around which have a 24bit RGB mapping?

Re: SenseHAT with PyBoard

Posted: Fri Aug 18, 2017 6:30 am
by pythoncoder
Sounds like a good idea. @deshipu has done a lot of work on modframebuf.c - it might be worth asking for his view.