{"id":2671,"date":"2020-08-16T15:43:11","date_gmt":"2020-08-16T05:43:11","guid":{"rendered":"https:\/\/jandmf.com\/?p=2671"},"modified":"2020-09-17T13:29:20","modified_gmt":"2020-09-17T03:29:20","slug":"an-even-bigger-small-display","status":"publish","type":"post","link":"https:\/\/jandmf.com\/index.php\/2020\/08\/16\/an-even-bigger-small-display\/","title":{"rendered":"An even bigger small display"},"content":{"rendered":"<div id=\"pl-2671\"  class=\"panel-layout\" ><div id=\"pg-2671-0\"  class=\"panel-grid panel-no-style\" ><div id=\"pgc-2671-0-0\"  class=\"panel-grid-cell\" ><div id=\"panel-2671-0-0-0\" class=\"so-panel widget_text panel-first-child panel-last-child\" data-index=\"0\" ><h3 class=\"widget-title\">Adafruit 240&#215;240 display<\/h3>\t\t\t<div class=\"textwidget\"><p>So after a bit of success with the previous two Adafruit displays I figured that I&#8217;d try their <a href=\"https:\/\/core-electronics.com.au\/adafruit-mini-pitft-1-3-240x240-tft-add-on-for-raspberry-pi.html\" target=\"_blank\" rel=\"noopener\">240&#215;240 display<\/a> so I ordered one and given the current COVID-19 induced postal delays it eventually arrived.<\/p>\n<p>I wasted no time in disabling the script that runs <a href=\"https:\/\/jandmf.com\/index.php\/2020\/08\/04\/a-slightly-bigger-display\/\">the 128&#215;64 display<\/a> and plugging in the new one.<\/p>\n<p>Getting it working with a sample Adafruit script took no time at all so I now had to write another Python3 script to run the bigger display. I worked out roughly what I wanted to put on it and in which orientation. With a decent font size and by tweaking the height and width parameters in the script I found that I had eleven lines to play with.<\/p>\n<p>As ever my Python3 skills are a bit Neanderthal so it took a while and was\u00a0<em>really, really<\/em> messy to start with. But at least it worked.<\/p>\n<p>Once I set to work putting a bit of doco in the script and cleaning it up a bit I only needed an hour or so to make it look a bit respectable, to me at least, and to have it still work. It&#8217;s <a href=\"https:\/\/jandmf.com\/files\/240x240.py\">here<\/a>\u00a0for your perusal if you so desire.<\/p>\n<p>It even looks fairly neat apart from the fan wires that are not connected any more due to the display taking the 5V pins. I&#8217;ll have to work out a way of sourcing the 5V from somewhere else although the fans aren&#8217;t really needed &#8211; the Pi 4 4GB usually runs at less than 60 deg C even when playing HD videos with VLC.<\/p>\n<figure id=\"attachment_2670\" aria-describedby=\"caption-attachment-2670\" style=\"width: 768px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2670 size-large\" src=\"https:\/\/jandmf.com\/wp-content\/uploads\/2020\/08\/BIRU-WP-20200816T150713GMT1000-768x1024.jpg\" alt=\"\" width=\"768\" height=\"1024\" srcset=\"https:\/\/jandmf.com\/wp-content\/uploads\/2020\/08\/BIRU-WP-20200816T150713GMT1000-768x1024.jpg 768w, https:\/\/jandmf.com\/wp-content\/uploads\/2020\/08\/BIRU-WP-20200816T150713GMT1000-225x300.jpg 225w, https:\/\/jandmf.com\/wp-content\/uploads\/2020\/08\/BIRU-WP-20200816T150713GMT1000.jpg 960w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><figcaption id=\"caption-attachment-2670\" class=\"wp-caption-text\">Adafruit Mini Pi tft 1.3-240&#215;240<\/figcaption><\/figure>\n<\/div>\n\t\t<\/div><\/div><\/div><div id=\"pg-2671-1\"  class=\"panel-grid panel-no-style\" ><div id=\"pgc-2671-1-0\"  class=\"panel-grid-cell\" ><div id=\"panel-2671-1-0-0\" class=\"so-panel widget_text panel-first-child panel-last-child\" data-index=\"1\" ><h3 class=\"widget-title\">What it displays<\/h3>\t\t\t<div class=\"textwidget\"><p>After a bit of messing around I have it displaying the date, the time, CPU temp, CPU and memory usage, disk usage, swap usage, uptime, boot time and three lines for button presses, etc. I&#8217;ll probably mess around with these lines and the button callbacks some time in the future.<\/p>\n<p>Anyway another success with an Adafruit display. If you have a look at the script that drives it you&#8217;ll no doubt see that my Python3 skills are lacking and that I&#8217;ve probably gone about everything in the most inefficient way possible.<\/p>\n<p>There are a few bits of the script that I found as code snippets and messed about with to get the results that I wanted, other bits are directly from Adafruit.<\/p>\n<p>For my next trick I want to have a slideshow running and have the buttons set up in such a way that I can switch what I&#8217;ve got now to a slideshow and back again. I was think to have both buttons present a sort of menu so that I can Poweroff, Reboot or go with a slideshow. I have absolutely how I&#8217;m going to do it yet though.<\/p>\n<p>Stand by for future developments. In the meantime, if you have any suggestions for the script(s) that I&#8217;ve already written please let me know.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n\t\t<\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>So after a bit of success with the previous two Adafruit displays I figured that I&#8217;d try their 240&#215;240 display so I ordered one and given the current COVID-19 induced postal delays it eventually arrived. I wasted no time in disabling the script that runs the 128&#215;64 display and plugging in the new one. Getting &hellip; <a href=\"https:\/\/jandmf.com\/index.php\/2020\/08\/16\/an-even-bigger-small-display\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;An even bigger small display&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[],"class_list":["post-2671","post","type-post","status-publish","format-standard","hentry","category-pi"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts\/2671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/comments?post=2671"}],"version-history":[{"count":5,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts\/2671\/revisions"}],"predecessor-version":[{"id":2789,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/posts\/2671\/revisions\/2789"}],"wp:attachment":[{"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/media?parent=2671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/categories?post=2671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jandmf.com\/index.php\/wp-json\/wp\/v2\/tags?post=2671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}