{"id":2132,"date":"2025-04-15T06:12:52","date_gmt":"2025-04-15T06:12:52","guid":{"rendered":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?post_type=spl_knowledgebase&#038;p=2132"},"modified":"2025-06-10T10:35:31","modified_gmt":"2025-06-10T10:35:31","slug":"example-lcd-backlight-auto-off-timers","status":"publish","type":"spl_knowledgebase","link":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/","title":{"rendered":"Example: LCD backlight auto-off timers"},"content":{"rendered":"\n<p>The white LED backlight used in certain LCD displays has a lifetime of about 3000 hours at full operating current (longer at reduced currents). This is an inherent limitation of the white LED technology (2009). It is therefore advisable to turn off or dim the backlight when not in use.<\/p>\n\n\n\n<p>This page contains several examples for either totally turning off or dimming the backlight after a certain time with no detected user activity. The light comes back on whenever a front panel button is pushed. Which of the examples you follow depends on:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Which controller you have, MMi202, MS120 or MS12<\/li>\n\n\n\n<li>For the MMi202, whether it has a dimmable LCD backlight (provided via a hardware modification introduced May 2009)<\/li>\n\n\n\n<li>Which version of\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o370\">Firmware<\/a>\u00a0is in the controller.<\/li>\n\n\n\n<li>If you are using MultiTrack<\/li>\n<\/ul>\n\n\n\n<h6 class=\"wp-block-heading\">Example 1: Simple on\/off for MS120 and MS12 using MultiTrack<\/h6>\n\n\n\n<p>The following program code will provide a simple auto-off timer for the MS120 or MS12 backlight. It turns on the backlight whenever a front panel button is pressed, and turns it off again 10 minutes after the last button press. This is designed as a\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/tutorials-application-notes-and-white-papers\/tutorial-multitrack\/\">MultiTrack<\/a>\u00a0task. This will work in any firmware that supports MultiTrack, providing your program already uses MultiTrack. All MS120s support MultiTrack. The MS12 requires firmware V3.13 or later. For more information see\u00a0<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/support-resources\/reflash-updating-the-firmware-in-your-controllers\/reflash-how-do-i-determine-what-version-firmware-is-in-my-controller\/\">reFlash: How do I determine what version firmware is in my controller?<\/a><\/p>\n\n\n\n<p>Your program&#8217;s initialisation code must contain a&nbsp;<code>GoSub BKLT_Init<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">BKLT_Init:      LaunchTask      BKLT_Set0\n                Return\n\nBKLT_Set0:      On              20      ;Turn On backlight\n                MarkTime\nBKLT_0:\n                YieldTask\n                InputFM         12      ;Get the front panel buttons\n                LoadX           %11111  ;select the 5 bits representing buttons\n                AndM\n                GoIfT           BKLT_Set0       ;G\/ any button pressed\n                LoopIfTiming    60000,BKLT_0    ;Test for timeout, loop if not yet\nBKLT_Set1:\n                Off             20      ;Turn Off backlight\nBKLT_1:\n                YieldTask\n                InputFM         12      ;Get the front panel buttons\n                LoadX           %11111  ;select the 5 bits representing buttons\n                AndM\n                GoIfT           BKLT_Set0 ;G\/ any button pressed\n                GoTo            BKLT_1<\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">Example 2: Dimmed backlight for MS120 with suitable firmware and MMi202 with suitable firmware and hardware.<\/h6>\n\n\n\n<p>If the MS120 has firmware V3.20 or later it incorporates a simple &#8220;set and forget&#8221; dimming mechanism.<\/p>\n\n\n\n<p>If the MMi202 contains firmware V3.21 or later&nbsp;<em>and it is fitted with a dimmable LCD<\/em>, it supports the same &#8220;set and forget&#8221; dimming mechanism.<\/p>\n\n\n\n<p>Your program can simply run the following code just after turn-on (i.e. in its initialization code) and the dimming will happen automatically:-<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">BL_HighLevel:   EQU        8    ;\"Bright\" level, 0 to 8, 8 = 100%\nBL_LowLevel:    EQU        1    ;\"Dimmed\" level, 0 to 8, 1 = 12.5%\nBL_DimTime:     EQU        30   ;Timer value, in minutes\n\n                OBLCD_Type 2    ;MUST be done before the dimmer stuff!!. Not required in MS12x\n                SetU       0,BL_HighLevel    \n                SetU       1,BL_LowLevel\n                SPxCmd2    1,!cpu  \n                SetU       0,BL_DimTime\n                SPxCmd1    4,!cpu<\/pre>\n\n\n\n<p>Note that&nbsp;<code>BL_HighLevel <\/code>and&nbsp;<code>BL_LowLevel <\/code>must be between 0 (fully off) and 8 (fully on). Any other value will generate an error.&nbsp;<code>BL_DimTime<\/code>&nbsp;can be 0 to 255. 0 will cause the backlight to dim immediately. 255 will give 4 hours and 15 minutes.<\/p>\n\n\n\n<p>With this mechanism the front panel push buttons are monitored automatically (you don&#8217;t have to do anything). Whenever a button is pressed it sets the backlight to&nbsp;<code>BL_HightLevel<\/code>&nbsp;and starts the timer. Every subsequent button press restarts the timer. If the timer expires the backlight is set to&nbsp;<code>BL_LowLevel<\/code>.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Example 3: Automatic detection of MS12 or MS120 and firmware version<\/h6>\n\n\n\n<p>This example lets your program automatically determine if it is running in an MS12, an MS120 with old firmware or an MS120 with newer firmware able to support backlight dimming, then initialize the display accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">BL_Init:        SPxPoll2        3,!<a href=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/glossary-of-terms\/#o431\">CPU<\/a>       ;get board type<br>                pushu           1<br>                GoIfXLT         53,BL_Old    ;MS12 is type numbers 48-52<br>BL_ms120:       SpxPoll2        0,!CPU       ;Get Firmware Number <br>                pushu           0<br>                push<br>                goifxgt         3,BL_New     ;Firmware is V4.x (something later than this code!)<br>;There has never been a firmware lower than 3.x, so assume 3.x and test the release number x<br>                pushu           1\t\t<br>                goifxge         20,BL_New    ;3.20 and later support dimming<br><br>BL_Old:    initialize non-dimmable backlight<br>                goto            BL_Finished     <br><br>BL_New:    initialize dimmable backlight<br><br>BL_Finished: ' ... continue ...<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The white LED backlight used in certain LCD displays has a lifetime of about 3000 hours at full operating current (longer at reduced currents). This&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2126,"menu_order":6,"template":"","class_list":["post-2132","spl_knowledgebase","type-spl_knowledgebase","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Example: LCD backlight auto-off timers - SPLat Controls<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Example: LCD backlight auto-off timers - SPLat Controls\" \/>\n<meta property=\"og:description\" content=\"The white LED backlight used in certain LCD displays has a lifetime of about 3000 hours at full operating current (longer at reduced currents). This...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/\" \/>\n<meta property=\"og:site_name\" content=\"SPLat Controls\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-10T10:35:31+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/\",\"name\":\"Example: LCD backlight auto-off timers - SPLat Controls\",\"isPartOf\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\"},\"datePublished\":\"2025-04-15T06:12:52+00:00\",\"dateModified\":\"2025-06-10T10:35:31+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Product documentation\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Product documentation: Onboard peripherals\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Onboard LCD\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"OBLCD: Programming\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"OBLCD: Examples\",\"item\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/\"},{\"@type\":\"ListItem\",\"position\":7,\"name\":\"Example: LCD backlight auto-off timers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"name\":\"SPLat Controls\",\"description\":\"OEM Embedded Machine Controllers\",\"publisher\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization\",\"name\":\"SPLat Controls\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"contentUrl\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg\",\"caption\":\"SPLat Controls\"},\"image\":{\"@id\":\"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Example: LCD backlight auto-off timers - SPLat Controls","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Example: LCD backlight auto-off timers - SPLat Controls","og_description":"The white LED backlight used in certain LCD displays has a lifetime of about 3000 hours at full operating current (longer at reduced currents). This...","og_url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/","og_site_name":"SPLat Controls","article_modified_time":"2025-06-10T10:35:31+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/","name":"Example: LCD backlight auto-off timers - SPLat Controls","isPartOf":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website"},"datePublished":"2025-04-15T06:12:52+00:00","dateModified":"2025-06-10T10:35:31+00:00","breadcrumb":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/example-lcd-backlight-auto-off-timers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/"},{"@type":"ListItem","position":2,"name":"Product documentation","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/"},{"@type":"ListItem","position":3,"name":"Product documentation: Onboard peripherals","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/"},{"@type":"ListItem","position":4,"name":"Onboard LCD","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/"},{"@type":"ListItem","position":5,"name":"OBLCD: Programming","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/"},{"@type":"ListItem","position":6,"name":"OBLCD: Examples","item":"https:\/\/webprojects.cloud\/wordpress\/splatco\/knowledgebase\/product-documentation\/product-documentation-onboard-peripherals\/onboard-lcd\/oblcd-programming\/oblcd-examples\/"},{"@type":"ListItem","position":7,"name":"Example: LCD backlight auto-off timers"}]},{"@type":"WebSite","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#website","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","name":"SPLat Controls","description":"OEM Embedded Machine Controllers","publisher":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webprojects.cloud\/wordpress\/splatco\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#organization","name":"SPLat Controls","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/","url":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","contentUrl":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-content\/uploads\/2024\/10\/logo.svg","caption":"SPLat Controls"},"image":{"@id":"https:\/\/webprojects.cloud\/wordpress\/splatco\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/2132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase"}],"about":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/types\/spl_knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/users\/1"}],"up":[{"embeddable":true,"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/spl_knowledgebase\/2126"}],"wp:attachment":[{"href":"https:\/\/webprojects.cloud\/wordpress\/splatco\/wp-json\/wp\/v2\/media?parent=2132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}