{"id":2885,"date":"2024-10-18T21:40:26","date_gmt":"2024-10-18T20:40:26","guid":{"rendered":"https:\/\/www.robertprice.co.uk\/robblog\/?p=2885"},"modified":"2024-10-19T00:07:05","modified_gmt":"2024-10-18T23:07:05","slug":"rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd","status":"publish","type":"post","link":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/","title":{"rendered":"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">So far in this year&#8217;s <a href=\"https:\/\/www.retrochallenge.org\/\">Retro Challenge<\/a> I&#8217;ve <a href=\"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-7-reading-the-rotary-encoder-using-z80-assembly-language\/\">designed and built my own Rotary Encoder Module<\/a> for the RC2014 computer. I&#8217;ve also worked out <a href=\"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-9-using-the-lcd-module-from-a-z80-assembly-language-program\/?_thumbnail_id=2879\">how to control an LCD screen from Z80 assembly language<\/a>. I now want to combine the two and use the rotary encoder to scroll text on the LCD screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;m building this on the <a href=\"https:\/\/rc2014.co.uk\/full-kits\/rc2014-classic-ii\/\">RC2014 Classic 2<\/a>, so I don&#8217;t have access to a file system. I will have to hardcode the text into the program.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve chosen to use the classic hacker song, <a href=\"https:\/\/gist.github.com\/ryanpcmcquen\/c2fe1dd50a16f7427e3c\">Puff The Fractal Dragon<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The LCD screen is 20 characters wide, so I will make things easy for myself and ensure every line is 20 characters long. I will pad shorter lines with spaces if necessary.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;m going to need a pointer to store my current position in the text. I&#8217;m calling this puffpointer. I also need to know the start of the text, I&#8217;m calling this puff. I&#8217;ll also need to know 4 lines before the end of the text. I&#8217;m calling this maxpuff. This is calculated in the assembler as the end of the text &#8211; 80. The 80 is 4 lines * 20 characters.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;m using the right turn to scroll down the text, and the left turn to scroll back to the top.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the right turn I need see if I&#8217;m at the end of the text or not. I need to compare puffpointer to maxpuff to see if they match. If they do, I&#8217;m at the button so I don&#8217;t want to go any further. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Z80 doesn&#8217;t allow us to directly compare 16bit values, so we have to do a bit of a workaround. We can instead clear the a register, then load the values we want to compare into de and hl register pairs. We can then subtract de from hl, and add de back to hl. If they are the same value the Z flag will be set so can test this. In this case, if Z is set we don&#8217;t want to do anything else so we can jump back to the main program loop.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    or a\n    ld de,maxpuff\n    ld hl,(puffpointer)\n    sbc hl, de\n    add hl, de\n    jp z,loop<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So if we are get past this point, we are safe to scroll down. We load the pointer to the current line in the text and add 20 to it. This moves us down a line. We then save it, and call our display routine.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    ld hl,(puffpointer)\n    ld bc,20\n    add hl,bc\n    ld (puffpointer),hl\n    call show_four_lines<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When turning left do a very similar procedure, except we check if puffpointer is at the start of the text. If it isn&#8217;t we subtract 20 from puffpointer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our final code looks like this.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    OUTPUT LCDScroll.z80\n\n    ORG $9000\n\nROTARYENCODER EQU $DE\nLCD_R   EQU 218\nLCD_D   EQU 219\n\n; The input bits from the rotary encoder.\nCLK1    EQU %00000001\nDT1     EQU %00000010\nSW1     EQU %00000100\n\n; show the inital first 4 lines on the LCD.\n    call setup_LCD\n\n    ld hl,(puffpointer)      ; the address of the text\n    call show_four_lines\n\nloop:\n; load the last clk value into register b\n    ld  a,(lastclk)\n    ld  b,a\n\n; read the input port and store in \"input\"\n    in  a,(ROTARYENCODER)\n    ld  (input),a\n\n; now check if the switch on first rotary encoder has been\n; pressed. If it has jump to end\n    and SW1\n    cp  SW1\n    jr  z, end\n\n; now see if clk1 matches the lastclk. If it does loop\n    ld  a,(input)\n    and CLK1\n    ld  (lastclk),a\n    cp  b\n    jr  z, loop\n\n; now work out what direction we are moving.\n; if CLK1 is 1 then we can can check DT1 to get the\n; direction of rotation. If it's 0, we need to go \n; back to the start of the loop.\n    ld  a,(input)          \n    and CLK1\n    cp  CLK1 \n    jr  nz, loop            \n\n; this is where we check DT1. If 1 we are turning left.\n    ld  a, (input)\n    and DT1\n    cp  0 \n    jr  nz, left\n\n; we must be turning right, so we need to advance \n; our text. We see if we are at the maximum, and\n; if not we advance a line and display.\nright:\n    or a\n    ld de,maxpuff\n    ld hl,(puffpointer)\n    sbc hl, de\n    add hl, de\n    jp z,loop\n\n    ld hl,(puffpointer)\n    ld bc,20\n    add hl,bc\n    ld (puffpointer),hl\n    call show_four_lines\n\n    jr  loop\n\n; we must be turning left, so we need to go\n; back. We see if we are at the start of the \n; text and if not we go back a line and display.\nleft:\n    or a\n    ld de,puff\n    ld hl,(puffpointer)\n    sbc hl, de\n    add hl, de\n    jp z,loop\n\n    ld hl,(puffpointer)\n    ld bc,20\n    sub hl,bc\n    ld (puffpointer),hl\n    call show_four_lines\n\n    jp  loop\n\n; the switch has been pressed, so we clear the output\n; and exit.\nend:\n    call clear_screen\n\n    ret\n\n\n; Sends a command byte to the LCD.\n; A - Command in\n; A, C registers used.\nsend_command:\n    out (LCD_R),a\n.lcd_busy:\n    in a,(LCD_R)\n    rlca\n    jr c,.lcd_busy\n    ret\n\n; Sends a data byte to the LCD\n; A - Byte in\n; A, C registers used.\nsend_data:\n    out (LCD_D),a\n.lcd_busy:\n    in a,(LCD_R)\n    rlca\n    jr c,.lcd_busy\n    ret\n\n; setup the LCD screen\nsetup_LCD:\n    ld a,56         ; Function 8 bit, 2 lines, 5x8 dot font\n    call send_command\n    ld a,12         ; Display on, cursor off, no blink\n    call send_command\n\n    call clear_screen\n\n    ret\n\n; clear the LCD screen\nclear_screen:\n    ld a,1          ; clear the display\n    call send_command\n    ret\n\n; Display 4 lines of consecutive text on the LCD\n; lines are shown 1-20,41-60,21-40,61-80 so we \n; need to jump around to display in order.\n; HL - address of text to display on the LCD\n; A, B, C, D, E, H, L registers used.\nshow_four_lines:\n\n; show the first 20 lines\n    ld b,20\n.line1loop:\n    ld a,(hl)\n    inc hl\n    call send_data\n    djnz .line1loop\n\n; jump forward 20 characters, and show\n    ld de,20\n    add hl,de\n    ld b,20\n.line2loop:\n    ld a,(hl)\n    inc hl\n    call send_data\n    djnz .line2loop    \n\n; jump back 40 characters, and show\n    ld de,40\n    sub hl,de\n    ld b,20\n.line3loop:\n    ld a,(hl)\n    inc hl\n    call send_data\n    djnz .line3loop\n\n; jump forward 20 characters, and show\n    ld de,20\n    add hl,de\n    ld b,20\n.line4loop:\n    ld a,(hl)\n    inc hl\n    call send_data\n    djnz .line4loop \n\n    ret      \n\n\n; stores the current input from the rotary encode.\ninput:\n    db  0\n; stores the last value of CLK1.\nlastclk:\n    db  0\n\n; stores a pointer to our current position in the text.\npuffpointer:\n    dw  puff\n; the text to show, each line must be 20 bytes long.\npuff:\n    db \"Puff the fractal    \"\n    db \"dragon was written  \"\n    db \"in C,               \"\n    db \"And frolicked while \"\n    db \"processes switched  \"\n    db \"in mainframe memory.\"\n    db \"                    \"\n    db \"No plain fanfold    \"\n    db \"paper could hold    \"\n    db \"that fractal Puff   \"\n    db \"                    \"\n    db \"He grew so fast no  \"\n    db \"plotting pack could \"\n    db \"shrink him far      \"\n    db \"enough.             \"\n    db \"Compiles and        \"\n    db \"simulations grew so \"\n    db \"quickly tame        \"\n    db \"And swapped out all \"\n    db \"their data space    \"\n    db \"when Puff pushed    \"\n    db \"his stack frame.    \"\n    db \"                    \"\n    db \"Puff the fractal    \"\n    db \"dragon was written  \"\n    db \"in C,               \"\n    db \"And frolicked while \"\n    db \"processes switched  \"\n    db \"in mainframe memory.\"\n    db \"Puff the fractal    \"\n    db \"dragon was written  \"\n    db \"in C,               \"\n    db \"And frolicked while \"\n    db \"processes switched  \"\n    db \"in mainframe memory.\"\n    db \"                    \"\n    db \"Puff, he grew so    \"\n    db \"quickly, while      \"\n    db \"others moved like   \"\n    db \"snails              \"\n    db \"And mini-Puffs      \"\n    db \"would perch         \"\n    db \"themselves on his   \"\n    db \"gigantic tail.      \"\n    db \"All the student     \"\n    db \"hackers loved that  \"\n    db \"fractal Puff        \"\n    db \"But DCS did not     \"\n    db \"like Puff, and      \"\n    db \"finally said,       \"\n    db \"\\\"Enough!\\\"           \"\n    db \"                    \"\n    db \"Puff the fractal    \"\n    db \"dragon was written  \"\n    db \"in C,               \"\n    db \"And frolicked while \"\n    db \"processes switched  \"\n    db \"in mainframe memory.\"\n    db \"Puff the fractal    \"\n    db \"dragon was written  \"\n    db \"in C,               \"\n    db \"And frolicked while \"\n    db \"processes switched  \"\n    db \"in mainframe memory.\"\n    db \"                    \"\n    db \"Puff used more      \"\n    db \"resources than DCS  \"\n    db \"could spare.        \"\n    db \"The operator killed \"\n    db \"Puff's job -- he    \"\n    db \"didn't seem to care.\"\n    db \"A gloom fell on the \"\n    db \"hackers; it seemed  \"\n    db \"to be the end,      \"\n    db \"But Puff trapped    \"\n    db \"the exception, and  \"\n    db \"grew from naught    \"\n    db \"again!              \"\n    db \"                    \"\n    db \"Puff the fractal    \"\n    db \"dragon was written  \"\n    db \"in C,               \"\n    db \"And frolicked while \"\n    db \"processes switched  \"\n    db \"in mainframe memory.\"\n    db \"Puff the fractal    \"\n    db \"dragon was written  \"\n    db \"in C,               \"\n    db \"And frolicked while \"\n    db \"processes switched  \"\n    db \"in mainframe memory.\"\npuffend:\nmaxpuff EQU puffend - 80<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s a video of the rotary encoder in action scrolling through the text of Puff The Fractal Dragon.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"LCD Scrolling on the RC2014\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/RwXkVP_n2P0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>So far in this year&#8217;s Retro Challenge I&#8217;ve designed and built my own Rotary Encoder Module for the RC2014 computer. I&#8217;ve also worked out how to control an LCD screen from Z80 assembly language. I now want to combine the two and use the rotary encoder to scroll text on the LCD screen. I&#8217;m building &hellip; <a href=\"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2889,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[113],"tags":[145,147,117,115,131,119],"class_list":["post-2885","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rc2024","tag-assembly-language","tag-lcd","tag-rc2014","tag-rc2024","tag-rotary-encoder","tag-z80"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD - Robert Price<\/title>\n<meta name=\"description\" content=\"I&#039;ve put together my work with the rotary encoder and lcd modules on the RC2014. This means I can now scroll text on LCD screen.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD - Robert Price\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve put together my work with the rotary encoder and lcd modules on the RC2014. This means I can now scroll text on LCD screen.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/\" \/>\n<meta property=\"og:site_name\" content=\"Robert Price\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-18T20:40:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-18T23:07:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.robertprice.co.uk\/robblog\/assets\/puffthefractaldragon.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"rob\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rob\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/\"},\"author\":{\"name\":\"rob\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#\\\/schema\\\/person\\\/fac6d5b076e0e14e1fb13e15b542a6c5\"},\"headline\":\"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD\",\"datePublished\":\"2024-10-18T20:40:26+00:00\",\"dateModified\":\"2024-10-18T23:07:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/\"},\"wordCount\":474,\"image\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/assets\\\/puffthefractaldragon.jpg\",\"keywords\":[\"Assembly Language\",\"lcd\",\"RC2014\",\"RC2024\",\"Rotary Encoder\",\"Z80\"],\"articleSection\":[\"RC2024\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/\",\"url\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/\",\"name\":\"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD - Robert Price\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/assets\\\/puffthefractaldragon.jpg\",\"datePublished\":\"2024-10-18T20:40:26+00:00\",\"dateModified\":\"2024-10-18T23:07:05+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#\\\/schema\\\/person\\\/fac6d5b076e0e14e1fb13e15b542a6c5\"},\"description\":\"I've put together my work with the rotary encoder and lcd modules on the RC2014. This means I can now scroll text on LCD screen.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/assets\\\/puffthefractaldragon.jpg\",\"contentUrl\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/assets\\\/puffthefractaldragon.jpg\",\"width\":1200,\"height\":900,\"caption\":\"Puff The Fractal Dragon on the RC2014 computer LCD.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#website\",\"url\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/\",\"name\":\"Robert Price\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.robertprice.co.uk\\\/robblog\\\/#\\\/schema\\\/person\\\/fac6d5b076e0e14e1fb13e15b542a6c5\",\"name\":\"rob\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"caption\":\"rob\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD - Robert Price","description":"I've put together my work with the rotary encoder and lcd modules on the RC2014. This means I can now scroll text on LCD screen.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/","og_locale":"en_GB","og_type":"article","og_title":"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD - Robert Price","og_description":"I've put together my work with the rotary encoder and lcd modules on the RC2014. This means I can now scroll text on LCD screen.","og_url":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/","og_site_name":"Robert Price","article_published_time":"2024-10-18T20:40:26+00:00","article_modified_time":"2024-10-18T23:07:05+00:00","og_image":[{"width":1200,"height":900,"url":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/puffthefractaldragon.jpg","type":"image\/jpeg"}],"author":"rob","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rob","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/#article","isPartOf":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/"},"author":{"name":"rob","@id":"https:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5"},"headline":"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD","datePublished":"2024-10-18T20:40:26+00:00","dateModified":"2024-10-18T23:07:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/"},"wordCount":474,"image":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/#primaryimage"},"thumbnailUrl":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/puffthefractaldragon.jpg","keywords":["Assembly Language","lcd","RC2014","RC2024","Rotary Encoder","Z80"],"articleSection":["RC2024"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/","url":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/","name":"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD - Robert Price","isPartOf":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/#primaryimage"},"image":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/#primaryimage"},"thumbnailUrl":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/puffthefractaldragon.jpg","datePublished":"2024-10-18T20:40:26+00:00","dateModified":"2024-10-18T23:07:05+00:00","author":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5"},"description":"I've put together my work with the rotary encoder and lcd modules on the RC2014. This means I can now scroll text on LCD screen.","breadcrumb":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/#primaryimage","url":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/puffthefractaldragon.jpg","contentUrl":"https:\/\/www.robertprice.co.uk\/robblog\/assets\/puffthefractaldragon.jpg","width":1200,"height":900,"caption":"Puff The Fractal Dragon on the RC2014 computer LCD."},{"@type":"BreadcrumbList","@id":"https:\/\/www.robertprice.co.uk\/robblog\/rc2024-part-10-using-the-rotary-encoder-to-scroll-the-lcd\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.robertprice.co.uk\/robblog\/"},{"@type":"ListItem","position":2,"name":"RC2024 \u2013 Part 10 \u2013 Using The Rotary Encoder To Scroll The LCD"}]},{"@type":"WebSite","@id":"https:\/\/www.robertprice.co.uk\/robblog\/#website","url":"https:\/\/www.robertprice.co.uk\/robblog\/","name":"Robert Price","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.robertprice.co.uk\/robblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5","name":"rob","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","caption":"rob"}}]}},"_links":{"self":[{"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/2885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/comments?post=2885"}],"version-history":[{"count":3,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/2885\/revisions"}],"predecessor-version":[{"id":2893,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/2885\/revisions\/2893"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/media\/2889"}],"wp:attachment":[{"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/media?parent=2885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/categories?post=2885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/tags?post=2885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}