28029 Parallax Inc, 28029 Datasheet - Page 42

KIT PARTS SMART SENSORS W/TEXT

28029

Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28029

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® or Javelin Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
28029PAR
Page 30 · Smart Sensors and Applications
The Scroll_Message Subroutine's Sliding Window
Let's say the shifting text display window in your LCD is four characters wide on the top
row because there are other messages that need to be displayed at all times on the LCD.
The task at hand is to slide the text through the smaller window without overprinting any
of the characters displayed outside it.
LOOP
RETURN
NEXT
PAUSE timeOff
SEROUT LcdPin, T9600, [cursorStart]
' This FOR...NEXT loop refreshes the message, shifted increment characters
' to the left each time through until the end of the EEPROM message.
' Then, it fills the display with space characters as the remainder of the
'
FOR pointer = head TO tail
NEXT
PAUSE timeOn
' Increment until at window-left
cursorStart = cursorStart - increment MIN windowLeft
tail = tail + increment
' Increment head pointer if tail pointer > window width.
IF tail > (windowRight - windowLeft) THEN
ELSE
ENDIF
SEROUT LcdPin, T9600, [" "]
IF (pointer <= (MessageEnd - MessageStart - 1)) THEN
ELSE
ENDIF
SEROUT LcdPin, T9600, [character]
head = 0
message shifts out to the window.
head = head + increment
READ pointer + MessageStart, character
character = " "
' Let characters fade away
' Rightmost character in window
' Give the characters some time
' Increment tail pointer
' Repeat scrolling loop

Related parts for 28029