{"id":636,"date":"2013-08-16T19:04:22","date_gmt":"2013-08-17T02:04:22","guid":{"rendered":"http:\/\/inkofpark.wordpress.com\/?p=636"},"modified":"2013-08-16T19:04:22","modified_gmt":"2013-08-17T02:04:22","slug":"raspberry-pi-character-lcd-degree-symbol","status":"publish","type":"post","link":"https:\/\/www.inkofpark.com\/?p=636","title":{"rendered":"Raspberry Pi Character LCD Degree Symbol"},"content":{"rendered":"<p>It is inevitable that you will want to write the degree symbol to your 16&#215;2 character LCD once you have it wired to the Pi. My son wired it up, and then wanted to display the degree symbol. In the past I have solved that problem for the Arduino using the Adafruit character LCD Arduino library createChar() function. Relatively painless for the Arduino. Unfortunately, the Adafruit LCD library for GPIO <em>not using i2c<\/em> does not have an equivalent of the createChar() function. Sad.<\/p>\n<p>The solution turns out to be easy. You rely on the fact that the LCD already has a degree symbol built in, and then use the write4bits() function to display it. There are other characters available, I found mine <a title=\"here\" href=\"http:\/\/http:\/\/forum.arduino.cc\/index.php\/topic,21371.0.html\">here<\/a>. Here is our code.<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# This is the process of importing the Adafruit library\nadafruitCharLCDPath = &amp;quot;\/home\/pi\/pylib\/AdafruitPy\/Adafruit_CharLCD&amp;quot;\nif not adafruitCharLCDPath in sys.path:\n    sys.path.append( adafruitCharLCDPath)\n    from Adafruit_CharLCD import Adafruit_CharLCD\n\nos.system(&#039;modprobe w1-gpio&#039;)\nos.system(&#039;modprobe w1-therm&#039;)\n\ntemp_c = 23.1\ntemp_f = 32. + temp_c*9.\/5.\n\nlcd = Adafruit_CharLCD()\nlcd.clear()\nlcd.message(&amp;quot;temp C&amp;quot;)\nlcd.write4bits( 0xDF, True)\nlcd.message(&amp;quot;: %.1fn&amp;quot;%temp_c)\n\nlcd.message(&amp;quot;temp F&amp;quot;)\nlcd.write4bits( 0xDF, True)\nlcd.message(&amp;quot;: %.1f&amp;quot;%temp_f)\n\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is inevitable that you will want to write the degree symbol to your 16&#215;2 character LCD once you have it wired to the Pi. My son wired it up, and then wanted to display the degree symbol. In the past I have solved that problem for the Arduino using the Adafruit character LCD Arduino [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[44],"class_list":["post-636","post","type-post","status-publish","format-standard","hentry","category-making","tag-raspberrypi"],"_links":{"self":[{"href":"https:\/\/www.inkofpark.com\/index.php?rest_route=\/wp\/v2\/posts\/636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inkofpark.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inkofpark.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inkofpark.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inkofpark.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=636"}],"version-history":[{"count":0,"href":"https:\/\/www.inkofpark.com\/index.php?rest_route=\/wp\/v2\/posts\/636\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inkofpark.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inkofpark.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inkofpark.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}