User avatar
experix
Posts: 204
Joined: Mon Nov 10, 2014 7:39 pm
Location: Coquille OR
Contact: Website

C programming sense-hat

Fri Jan 08, 2016 9:32 pm

I installed the sense-hat software and found 2 examples of C programming in /usr/src/sense-hat/. Have not found device documentation yet except for a block diagram and the schematic PDF. I want to write C programs to operate it. Are there more resources available? How about a list of ioctl's, library calls and so on and what they do?
'sense-hat' and 'astro-pi' seem to be equivalent terms-- is that correct?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6228
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: C programming sense-hat

Mon Jan 11, 2016 7:02 am

Sense HAT refers to the board itself. Astro Pi is the whole unit assembly up on the ISS.

You'd mostly be talking to the devices directly over I2C, so you'll need to get the datasheets. The joystick and framebuffer are the only ones which are proper linux devices (so the standard documentation from the linux kernel applies to those).

User avatar
buja
Posts: 563
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: C programming sense-hat

Mon Jan 11, 2016 8:46 am

Maybe this is useful info: http://pinout.xyz/pinout/sense_hat

Another approach would be to reverse engineer the Python source code.

modwizcode
Posts: 1
Joined: Fri Jan 16, 2015 1:50 pm

Re: C programming sense-hat

Wed Jan 27, 2016 9:26 pm

This isn't too big a challenge, the python library just talks to a C++ library for IMU sensors that is up on GitHub, same user as the Sense Hat python repository. Pure C programming is easily possible, but the IMU library has a lot of huge benefits like sensor fusion.

Return to “Astro Pi”