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 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.