Latest commits (Ultibo core 2.0.235)

Releases, updates and announcements from the Ultibo team.
mark
Posts: 1127
Joined: Mon Oct 03, 2016 2:12 am
Location: Indianapolis, US

Re: Latest commits (Ultibo core 2.0.235)

Postby mark » Mon May 14, 2018 9:42 am

Ultibo wrote:
mark wrote:I might have overlooked the announcement but there is a Sende HAT example:

True, we said about the Sense HAT driver but didn't ever mention the new example.

Thanks for pointing it out, it's a good example too ;)

Is there a means of determining whether a sense hat is actually connected to the pi? Thanks, Mark.
Ultibo - The Internet of Things that Just Work
User avatar
Ultibo
Site Admin
Posts: 1895
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Latest commits (Ultibo core 2.0.235)

Postby Ultibo » Mon May 14, 2018 11:20 pm

mark wrote:Is there a means of determining whether a sense hat is actually connected to the pi?

If you look at the RPiSenseStart() function in the RPiSenseHat unit you will see two reads early in the initialization.

These read RPISENSE_WAI and RPISENSE_VER and based on the Linux driver are the "official" way to detect if a Sense HAT is present at the specified I2C address.

The driver allows you to set RPISENSE_AUTOSTART to False either from the command line or as part of an init unit during boot and then manually call RPiSenseStart() to create the relevant devices, you could perform those two I2C reads and use the result to determine whether to proceed with initializing the device.
Ultibo.org | Make something amazing
https://ultibo.org

Return to “Ultibo”

Who is online

Users browsing this forum: No registered users and 1 guest