<div dir="ltr">Wow this is great thanks aapo! I was actually thinking about just writing a shell script to echo 0 into that file but I like this way alot better. Do you think you could walk me through the python script? I'm not much of a python guru and already I can't find out why open() has a third argument. I'm only used to seeing two and searching open for 3 arguments comes up with nothing. I don't get the purpose of writing numbers to the file? Do the numbers control how much it fades? and what is 63 for? Where did you find out about '/<b>sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/backlight/pcf50633-bl/brightness'</b> ? Thanks again for all your help!<br>
<br>Lynn<br><br><div class="gmail_quote">On Thu, Aug 14, 2008 at 1:07 PM, Aapo Rantalainen <span dir="ltr"><<a href="mailto:aapo.rantalainen@gmail.com">aapo.rantalainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2008/8/14 Lynn Nguyen <<a href="mailto:lynn.mesl@gmail.com">lynn.mesl@gmail.com</a>>:<br>
<div class="Ih2E3d">> I mean, is there some way to control it within in application? In like say<br>
> C, python, or java? Not on a shell?<br>
<br>
<br>
</div>I think best way to tell something is use shell. This is some python<br>
application to fade screen black and light again. This is not screen<br>
saver, there is no input reading etc. This is only my way to say how<br>
shell -> python (or if you can write in file with java, then shell -><br>
java)<br>
<br>
Should this be in wiki? And what is the right page?<br>
<br>
<br>
#!/usr/bin/python<br>
"""Dims backlight (and lights its again)<br>
<br>
Usage: python dim.py<br>
"""<br>
import sys<br>
import time<br>
<br>
def dim():<br>
global brig<br>
brig = open("/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/backlight/pcf50633-bl/brightness",<br>
"w", 1)<br>
duration = 0.200<br>
<br>
for i in range(7):<br>
brig.write(str((6-i)*10) + "\n")<br>
time.sleep(duration)<br>
<br>
time.sleep(duration*5)<br>
<br>
for i in range(7):<br>
brig.write(str(i*10) + "\n")<br>
time.sleep(duration)<br>
<br>
<br>
brig.write(str(63) + "\n")<br>
brig.close()<br>
<br>
if __name__ == "__main__":<br>
dim()<br>
<br>
<br>
-Aapo Rantalainen<br>
<br>
<br>
> haha no.<br>
<div class="Ih2E3d">><br>
><br>
> Thanks!<br>
> Lynn<br>
><br>
> On Wed, Aug 13, 2008 at 3:12 PM, Andy Green <<a href="mailto:andy@openmoko.com">andy@openmoko.com</a>> wrote:<br>
>><br>
>> -----BEGIN PGP SIGNED MESSAGE-----<br>
>> Hash: SHA1<br>
>><br>
>> Somebody in the thread at some point said:<br>
>> | Andy Green wrote:<br>
>> |> Somebody in the thread at some point said:<br>
>> |> | Hello all--<br>
>> |> |<br>
>> |> | I was wondering, is there some sort of application that will let me<br>
>> |> | manually fade the openmoko screen to black? Similar to a screen<br>
>> saver?<br>
>> |> | Thanks!<br>
>> |><br>
>> |> What are you, some kind of Goth? :-)<br>
>> |><br>
>> |> echo 0<br>
>> |><br>
>><br>
>> |/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/backlight/pcf50633-bl/brightness<br>
>> |><br>
>> |> -Andy<br>
>> | Now there's a thought! A Goth theme with black buttons on a black<br>
>> | background that light up black when pressed. And a black screensaver.<br>
>><br>
>> Just turn the thing off, we can say it is "hardcore goth" ;-) and it<br>
>> never fails to meet user expectations either...<br>
>><br>
<br>
</div><div><div></div><div class="Wj3C7c">_______________________________________________<br>
support mailing list<br>
<a href="mailto:support@lists.openmoko.org">support@lists.openmoko.org</a><br>
<a href="https://lists.openmoko.org/mailman/listinfo/support" target="_blank">https://lists.openmoko.org/mailman/listinfo/support</a><br>
</div></div></blockquote></div><br></div>