Re: [support-gang] XO brightness key operation

2012-04-09 Thread Paul Fox
nicholas wrote:
  Is there a way to read the current value of the 1.75's ambient light
  sensor? It'd be neat if that could be displayed by an activity.

there is.  turtleart can do this, i believe.
http://wiki.laptop.org/go/Light_Sensor#Programming

paul
=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Re: [support-gang] XO brightness key operation

2012-04-09 Thread forster
 nicholas wrote:
   Is there a way to read the current value of the 1.75's ambient light
   sensor? It'd be neat if that could be displayed by an activity.
 
 there is.  turtleart can do this, i believe.
 http://wiki.laptop.org/go/Light_Sensor#Programming
 

see
http://wiki.sugarlabs.org/go/Activities/Turtle_Art#Device_I.2FO
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [support-gang] XO brightness key operation

2012-04-09 Thread Nicholas Doiron
Is there a way to read the current value of the 1.75's ambient light
sensor? It'd be neat if that could be displayed by an activity.

--
Nick Doiron
Code for America
On Apr 9, 2012 9:16 AM, Paul Fox p...@laptop.org wrote:

 i just sent this to the folks working on the current doc sprint, and
 then realized it probably deserves a wider audience.  operation of the
 brightness keys was enhanced a bit in 11.3.1, based on discussion on
 the devel list, but i don't recall that i ever sent out a summary mail.

 for convenience, i'm going to refer to the brightness keys as BrUp and
 BrDown here.

 on all laptops, in all sofware releases to date:

- the unmodified BrUp and BrDown keys adjust the brightness in 15
steps.  when turning the backlight all the way off (i.e.,
the lowest setting) the display will switch into the higher
resolution monochrome mode.

- using the Alt-BrUp and Alt-BrDown combinations will immediately
change the backlight to its maximum and off values (including the
change to monochrome when off).

 in release 11.3.1 and later, on all laptops:

- the Ctrl-BrUp and Ctrl-BrDown combinations don't actually change
the backlight level, but rather will toggle the screen between
normal mode and the higher resolution monochrome mode.  this
monochrome mode will be sticky, so further normal use of the
keys will adjust the brightness but won't restore color.  this
can be useful if you want the higher resolution, and don't
currently need to have color displayed.  unfortunately, there
is currently no way to enter this semi-permanent monochrome
mode via the Sugar user interface -- only Ctrl-BrDown will do it.

 and finally, on XO-1.75 only:

- the backlight may automatically turn off when the laptop is in
bright sunlight.  when this happens, it is _not_ put into the
hi-res monochrome mode.  when the light level returns to
normal -- i.e., indoor or shady light -- the backlight will
be restored to its previous value.

the ambient light sensor shares the opening in the plastic
with the LED that looks like (o) near the lower left corner
of the screen, so covering that location when outside, or
shining a bright light on it when inside, may cause the
backlight level to change.


 it's also worth noting that the F9 and F10 keys are, by default, the
 brightness keys, and are intercepted by system software before a
 running program can receive them.  if the Fn key is pressed at the
 same time as F9 or F10, then the keys instead generate the true F9 and
 F10 codes, and are available to the current application (or perhaps
 the window manager).  this is also true of the volume keys on F11 and
 F12 -- on any of our keyboards, holding Fn will force the top row of
 keys to generate F1 through F12.

 finally:  all of the above functionality is available from the
 shell commandline:

$ olpc-brightness -h
usage: olpc-brightness [up|down|max|min|0-15|color|mono]


 paul
 =-
  paul fox, p...@laptop.org
 ___
 support-gang mailing list
 support-g...@lists.laptop.org
 http://lists.laptop.org/listinfo/support-gang

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Re: [support-gang] XO brightness key operation

2012-04-09 Thread forster
 Is there a way to read the current value of the 1.75's ambient light
 sensor? It'd be neat if that could be displayed by an activity.
 

Yes its documented at 
http://wiki.sugarlabs.org/go/Activities/Turtle_Art#Device_I.2FO

what you want I think is
/sys/devices/platform/olpc-ols.0/level 

Tony
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [support-gang] XO brightness key operation

2012-04-09 Thread Chris Ball
Hi,

On Mon, Apr 09 2012, Nicholas Doiron wrote:
 Is there a way to read the current value of the 1.75's ambient light sensor?
 It'd be neat if that could be displayed by an activity.

Yes, /sys/devices/platform/olpc-ols.0/level

You can read powerd's source on the XO; it uses a more complicated API
involving setting limits of high and low light to change the backlight.

- Chris.
-- 
Chris Ball   c...@laptop.org   http://printf.net/
One Laptop Per Child
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [support-gang] XO brightness key operation

2012-04-09 Thread James Cameron
G'day Kevin

I was responsible for the idea to use an LED as a cheap light sensor on
the XO-1.75, built the first prototype, and have been following the
feature since.

To use an LED as a light sensor requires a special connection method;
either the LED must be mounted in reverse, or both terminals of the LED
must be directly connected to software driven input/output pins on a
microcontroller or CPU.

Mounting the LED in reverse prevents it from being used as an indicator.

Using two software driven pins is an additional cost if there is a
limit on the number of pins available.

The embedded controller has a limit on the current it can supply to
LEDs.

None of the LEDs on XO-1 or XO-1.5 are connected in a way that supports
their use as a light sensor.

All of the LEDs on XO-1 or XO-1.5 are connected to driving transistors
or MOSFETs.  This is so that two LEDs, front and back of the hinged
section, can be driven at the same time, with a tiny current draw from
the embedded controller.  But driving these LEDs in this way also
effectively prevents their use as light sensors.

I suggest that if you want to experiment with using LEDs as light
sensors, that you get yourself an Arduino or similar, and play with
that.  It is much easier than opening an XO and changing the wiring.
;-)

-- 
James Cameron
http://quozl.linux.org.au/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel