Skip to content
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

Error with sense.low_light and sense.gamma #145

Open
Gaetanb76 opened this issue Oct 19, 2024 · 0 comments
Open

Error with sense.low_light and sense.gamma #145

Gaetanb76 opened this issue Oct 19, 2024 · 0 comments

Comments

@Gaetanb76
Copy link

Gaetanb76 commented Oct 19, 2024

Hi,

I wanted to test to reduce the light of the matrix led then I use the site
https://pythonhosted.org/sense-hat/api/
and go to the "low_light" section.

I tried this code :

import time
from sense_hat import SenseHat

sense = SenseHat()
sense.clear(255, 255, 255)
sense.low_light = True
time.sleep(2)
sense.low_light = False

The leds light in white but after this message appears
fcntl.ioctl(f, self.SENSE_HAT_FB_FBIORESET_GAMMA, cmd)
OSError: [Errno 25] Inappropriate ioctl for device

then, I tried this one :

import time
from sense_hat import SenseHat

sense = SenseHat()
sense.clear(255, 127, 0)

print(sense.gamma)
time.sleep(2)

sense.gamma = reversed(sense.gamma)
print(sense.gamma)
time.sleep(2)

sense.low_light = True
print(sense.gamma)
time.sleep(2)

sense.low_light = False

and the result was :
fcntl.ioctl(f, self.SENSE_HAT_FB_FBIOGET_GAMMA, buffer)
OSError: [Errno 25] Inappropriate ioctl for device

I use a Raspberyy pi 4 8GB with a Sense Hat v2 module
I use Thonny Python
The OS is Raspbian bookworm
python --version
Python 3.11.2

pip freeze
RTIMULib==7.2.1
sense-hat==2.6.0
thonny==4.1.4

Thanks for your help

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

1 participant