Author Topic: NHD-0420CW-Ax3 Scrolling Text - intended usage?  (Read 1007 times)


  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
NHD-0420CW-Ax3 Scrolling Text - intended usage?
« on: January 13, 2018, 01:28:45 PM »
Hi everyone,

I'm trying to implement the text scrolling functionality of this display/controller in my driver and I have it basically working, but I'm having difficulty determining if I'm really using it correctly.

First, before I started implementing it, I got the impression the number of pixels to scroll was relative, i.e., if I kept issuing a command to scroll 1 pixel, that it would keep scrolling by one more pixel every time, however, it seems that the number of pixels to scroll is an absolute value, i.e., it would shift the display by 1 pixel the same location every time, or if 48 pixels, it'd be the same location every time. I hope this isn't too difficult to understand, but does this sound correct?

Secondly, if I do have the basic understanding correct, then would someone be able to suggest a short example, even pseudocode? Here's a snippet I have right now:
Code: [Select]
    repeat i from 48 to 0
      oled.SetScrollQty (i)
      oled.Position (0, 0)
      oled.Str (string("Scrolling"))
      time.MSleep (30)


    repeat i from 48 to 0
      oled.SetScrollQty (i)
      oled.Position (10, 0)
      oled.Str (string("Scrolling"))
      time.MSleep (30)

This is written in SPIN. repeat used here would be equivalent to a "for (i=0; i < 49; i++)"-loop (and another in the opposite direction) in C. The rest I think should be pretty self-explanatory, except I'll mention that oled.SetScrollQty pokes the us2066 Set Scroll Quantity register (0x80). So the bytes that go out are (0x80 | i). The string "Scrolling" does scroll across the display using this code, but because there is only a maximum of 48 pixels scroll, I have to change the DDRAM address (oled.Position) after the first loop and repeat the process, in order to make it appear that the string is smoothly scrolling across the whole display. This is really where I'm asking for help, and to re-iterate, if I'm even using the functionality the way it's intended (if not, please let me know - I'd rather implement it the way it's intended to be used, at least at first).

Lastly, I'll add I'm currently doing this with double height text disabled, though I've tried it with it enabled as well, with the same results.

Thanks very much!


NHD‐0420CW‐AB3 I2C Interface

Started by andersonpdBoard OLEDs

Replies: 1
Views: 5225
Last post January 23, 2015, 10:00:06 AM
by Michael_L
NHD‐0420CW‐AG3 Contrast question

Started by RichardRBoard OLEDs

Replies: 2
Views: 4822
Last post January 16, 2016, 09:52:02 AM
by RichardR
NHD‐0420CW‐AG3 + I2C + PIC assembly code: trouble getting started

Started by RichardRBoard OLEDs

Replies: 4
Views: 6958
Last post December 17, 2015, 03:12:49 AM
by RichardR
NHD-0420CW-Ax3 Driver (w/demo) written for Parallax P8X32A/Propeller MCU

Started by avsa242Board OLEDs

Replies: 1
Views: 1936
Last post January 09, 2018, 04:48:45 PM
by Paul_B
0420CW-AB3 I2C Talking, Display is off and low current drawn

Started by AreswayBoard OLEDs

Replies: 3
Views: 4721
Last post February 10, 2015, 07:39:49 AM
by Paul_B