{"id":213,"date":"2011-11-23T16:21:53","date_gmt":"2011-11-23T21:21:53","guid":{"rendered":"http:\/\/www.jetmore.org\/john\/blog\/?p=213"},"modified":"2011-11-23T16:21:53","modified_gmt":"2011-11-23T21:21:53","slug":"abusing-a-character-display","status":"publish","type":"post","link":"https:\/\/www.jetmore.org\/john\/blog\/2011\/11\/abusing-a-character-display\/","title":{"rendered":"Abusing a Character Display"},"content":{"rendered":"<p>One of the first things I bought to use with my arduino was a 2&#215;16 character display, specifically <a href=\"http:\/\/www.adafruit.com\/products\/399\">this one<\/a> from Adafruit. \u00a0Playing with it was fine, but after looking at the interface to the LiquidCrystal library I decided to see if I could abuse it by making it into a cheap-o Etch-a-Sketch.<\/p>\n<p>Stage 1 of this project worked fine, and was actually a bit of fun (although it was kind of cheating &#8211; I&#8217;m supposed to be challenging myself with hardware, and this was really all just programming). \u00a0I knocked up a couple of trimmers to use as the knobs, whipped up some modulo arithmetic, and I turned my 16&#215;2 character display into a 80&#215;16 pixel display.<\/p>\n<p>Here&#8217;s a not-great video of the result:<\/p>\n<p><iframe loading=\"lazy\" width=\"584\" height=\"438\" src=\"http:\/\/www.youtube.com\/embed\/UdO1U-fkdNs?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>Next I wanted to make drawing persistent, to be able to actually draw. \u00a0Seemed simple enough &#8211; I had been building custom characters on every update, with the current x,y bit turned on, then writing that char to the correct x,y character position. \u00a0All I should have to do it maintain an array of characters. \u00a0Then on each iteration when I set the x,y position, it&#8217;s an update, not an entirely new character. \u00a0Then when I write the character out, I&#8217;ll get the entire state for the board.<\/p>\n<p>Unfortunately, this exposed a pretty fundamental misunderstanding I had of the character displays. \u00a0I assumed that since I was only updating a single &#8220;character&#8221; at each loop, all the characters I wasn&#8217;t touching would just stay put. \u00a0However, when I re-create the custom character at each loop, that also updates every place on the display that was showing that &#8220;character&#8221;. \u00a0It actually looks fairly interesting as, over time, multiple characters on the screen start to come to life and start changing in sympathy with each other. \u00a0Cool, but not at all what I wanted.<\/p>\n<p>This failure completely makes sense as I think about it. \u00a0Since the LiquidCrystal library only supports 8 unique custom characters I can&#8217;t make use of the whole screen just through the standard library. \u00a0It&#8217;s possible that the 8 character limitation is arbitrary and that I could raise it by mucking around in the library, but that doesn&#8217;t sound like that much fun.<\/p>\n<p>There are a couple of possible next steps I could take here:<\/p>\n<ol>\n<li>Just to show the core of what I wanted to do, use the 8 custom characters I get from the LiquidCrystal library to make a 2&#215;4 character (16&#215;20 pixel) display. \u00a0I will probably do this and take a video of it just to have done it. \u00a0One of the original goals in this project was to just make anything that I wasn&#8217;t copying from someone else. \u00a0Ideas include a write\/erase function, &#8220;status&#8221; lights, an &#8220;invert&#8221; button, a non-state-changing cursor, basically anything to take up a pin on the Arduino. \u00a0Now that I write this down and remember what my goal was, I&#8217;ll probably do this no matter what<\/li>\n<li>I could track down the LiquidCrystal library and understand what the root of the 8-custom-character limit is. \u00a0If it&#8217;s an arbitrary software limit, maybe raise it and recompile. \u00a0If it&#8217;s not arbitrary but due to memory, maybe make a custom version of the library in which some standard characters are missing, allowing me to use their memory space for more custom chars. \u00a0I doubt I do this anytime soon, but if I decide to play around more with Arduino libraries, this might be a fun platform to learn more about them.<\/li>\n<li>If the limit on the number of custom characters turned out (somehow) to be hardware based, then I could skip the LiquidCrystal library altogether and see if I could somehow force the hardware to do what I want if I give up on the need for standard characters. \u00a0I think the only way I would do this is if I actively needed to learn about the LCD chipset&#8217;s low level use for some other reason.<\/li>\n<li>There&#8217;s a strong possibility that I may bag everything above because I had an idea for a new project that I want to get working using my Arduino. \u00a0Since this is the most interesting thing I&#8217;ve made that I haven&#8217;t copied form someone else, I should take this opportunity to think about how I will store project information. \u00a0I&#8217;m not fond of the Arduino dev environment&#8217;s file system layout requirements and concessions I have to make to it to use SVN, but I do have this sketch in SVN. \u00a0Need to lean more about creating and storing schematics. \u00a0Can I store them with the Arduino sketch without the Arduino software complaining? \u00a0What&#8217;s the best software to use? \u00a0Right now I just want to sketch something out that I can use to recreate the circuit later, and that I can put in version control. \u00a0ASCII art would work right now, but I wonder if there&#8217;s an advantage to finding more specific software this early in my learning cycle&#8230;<\/li>\n<\/ol>\n<p>Right. \u00a0Disappointed that my original idea didn&#8217;t work, but still plenty to learn in that list above. \u00a0I wonder if I can get 1 and 4 done while waiting for parts for NewProjectIdea?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the first things I bought to use with my arduino was a 2&#215;16 character display, specifically this one from Adafruit. \u00a0Playing with it was fine, but after looking at the interface to the LiquidCrystal library I decided to &hellip; <a href=\"https:\/\/www.jetmore.org\/john\/blog\/2011\/11\/abusing-a-character-display\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/213"}],"collection":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":0,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}