Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - avsa242

Pages: [1]
1
OLEDs / 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
    repeat i from 48 to 0
      oled.SetScrollQty (i)
      oled.Position (0, 0)
      oled.Str (string("Scrolling"))
      time.MSleep (30)

    oled.Clear

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

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!
Jesse

2
HI folks,

I recently bought one of these in yellow and wanted to get it running with Parallax's P8X32A microcontroller (https://www.parallax.com/downloads/p8x32a-propeller-datasheet). I wrote a driver/object for interfacing with the display over I2C (tested ~1kHz-400kHz), but plan to try an SPI version as well. It includes demo code, as well (for the uninitiated, everything is written in SPIN - a language of Parallax's design).

I've put the code up on github for anyone that may be interested (MIT license) at: https://github.com/avsa242/nhd-0420 as well as a video of the demo code, for those that may not have a Prop:
https://youtu.be/3UX8yH5YcDk

Cheers, and thanks Newhaven for these nice display modules!

Pages: [1]