如何在微处理器/控制器上制作滚动条?
我想在带有 4 个 5x7 显示器的 ANSI-C 微处理器上编写一个文本滚动器。
有谁知道示例源代码或任何可以帮助我开始的东西?
更新
这是我拥有的微处理器板的用户手册。 PDF 第 17 页上有一张带有显示屏的主板图片。
该代码在名为“zds2_Z8Encore493.exe”的IDE中编写,然后通过串行端口刷新到微控制器。
我希望文本从一列级联到下一列,这样就很流畅。
I would like to write a text scroller on a micro-processor with 4 5x7 displays in ANSI-C.
Does anyone know of example source code or anything that can help me get started?
Update
This is the user manual for the micro-processor board I have. On PDF page 17 is a picture of the board with the displays.
The code is written in an IDE called "zds2_Z8Encore493.exe" and then flashed to the micro-controller over serial port.
I would like the text to cascade from one to the next to the next column-by-column, so it is smooth.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能有更好的方法,但我会将文本存储在 RAM 块中,并且在更新显示的例程中,我将包含一个值来偏移起始点,可能会环绕到起始点。您存储一个计数器,该计数器会增加“全局”偏移量(滚动)。
然后,您可以使用 string[offset + display-width +scroll_position] 作为开始指针,但您需要检测结束并绕回或只是停止。
There may be a better way, but I would store the text in a block of RAM, and in the routines that update the displays I would include a value to offset the starting point, possibly with a wrap-around to the start. The you store a counter which increments the "global" offset (scrolling).
You can then use
string[offset + display-width + scroll_position]
as the start pointer, but you need to detect the end and wrap round or just stop.