Personal tools
Document Actions

Use of the light sensor

Up to Scripts

Use of the light sensor

Posted by Vincent Fretin at April 16. 2007

It's my first script in Python. I hope it will be useful to you too!


Description
This script use the light sensor.
This script check every second the light level and say something according to the value.
The evening, when you are in front of the computer, Tux will say "Il fait noir." (It is dark.).
5 minutes later he will say "Tu devrais allumer la lumière" (You should turn the light on.).
If you turn the light on, it will say "Il fait clair" (It is bright.)
If you an evil man and you move a light source in front of his eyes,
he will close his eyes and say "Je suis éblouie" (I'm dazzled.)
Then if you close the light, he will say "Merci ça va mieux" (Thanks, it's better.).


Requirements
tuxdaemon and tuxttsdaemon running


Launch
python light.py


Attachments

Re: Use of the light sensor

Posted by Thomas Carpentier at April 16. 2007

Thanks Vincent,


I will test it


Re: Use of the light sensor

Posted by oswald-p at April 16. 2007

Thanks!


It is really funny!


I like it...






O-p


Re: Use of the light sensor

Posted by Dimitri CLATOT at April 17. 2007
Vraiment très drole !



Re: Use of the light sensor

Posted by Vincent Fretin at April 19. 2007

New version !


2007/04/19 - version 1.1:
    - compatible with API 0.2.0
    - use of tux.event.on_light_level
    - fixed the next sentence algorithm in dark mode (You can add new sentences!)
    - open and close mouth when Tux speak, except when he close his eyes
    - check that level != None


Attachments
Powered by Ploneboard
You are here: Home Forum Scripts Use of the light sensor

Powered by Plone CMS, the Open Source Content Management System