- From: Dave Raggett <dsr@w3.org>
- Date: Wed, 21 Oct 2015 18:16:15 +0100
- To: Public Web of Things IG <public-wot-ig@w3.org>
- Message-Id: <A9B1BA83-1345-4691-A73D-263D4D4D0C46@w3.org>
My travel, EU reports, and work on EU funding for W3C staff have severely curtailed the time I have for working on my demo which has been frustrating. As a consequence, my plugfest demo won’t be finished in time for TPAC. One development task that I’ve looked at very briefly is the need for algorithmically mapping the colour temperature and brightness to RGB values for the white light source called for in the plugfest. I bought a pack of cheap RGB LEDs, with a view to using pulse width modulation to control the intensity of the red, green and blue diodes. This involves programming the PWM values for the GPIO pins and choosing appropriate resistor values. The code for smoothly transitioning from one set of values to another over a given period of time, can likewise use interpolation and a hardware timer interrupt[1]. The Tanner-Helland algorithm [2] involves natural logarithms and floating point operations which are expensive for low end microcontrollers. The alternative is to use tables and interpolation. I would be interested in how others have been tackling this! [1] The timer interrupt service request pushes a “tick" event onto an event queue that is dispatched from the Arduino “loop” method for a programming model analogous to web pages. The “tick” event is also used to time resending of messages when waiting for acknowledgement of receipt, as a key part of my code for reliable in-order delivery of messages over UDP. [2] http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/ Best regards, — Dave Raggett <dsr@w3.org <mailto:dsr@w3.org>>
Attachments
- text/html attachment: stored
- image/jpeg attachment: rgb_led_common_cathode.jpg
Received on Wednesday, 21 October 2015 17:16:29 UTC