控制连接到串行端口的设备的亮度 [英] Control brightness of device attached to serial port

查看:96
本文介绍了控制连接到串行端口的设备的亮度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何控制连接到串行端口的设备的亮度?
我想通过串行端口与招牌通信,也想使用滑块控件(其值介于0-255之间)控制亮度.

等待您的回应.
谢谢

Hello All,

How can control the brightness of a device which is attached to Serial Port?
I want to communicate with the signboard via a serial port and also I want to control the brightness using a slider control, whose value is from 0-255.

Awaiting your response.
Thanks

推荐答案

您需要查看招牌的规格.在那里,您应该找到协议和控制其使用各个方面的命令,包括亮度.

您需要将问题分解为更小的部分.您将需要代码来通过串行端口进行通信(代码项目"的文章"部分中有示例).另外,您需要确定是否可以使用内置的滑块控件或是否编写自己的滑块.

当我需要控制硬件时,通常我会从一个简单的编辑框开始输入数据,一旦工作正常,我便开始为客户添加用户友好"控件.

祝你好运. :)
You need to look at the specification for your Signboard. There you should find the protocol and the commands that control each aspect of it''s use including the brightness.

You need to break the problem down into smaller parts. You will need code to communicate over the Serial port (there are examples in the Articles section on Code Project). Also, you need to decide whether you can use the built in slider control or whether to write your own.

When I need to control hardware I normally start with a simple edit box to enter data, once that is working I move on to adding a ''user friendly'' control for the customer.

Best of Luck. :)


您需要使用类System.IO.Ports.SerialPort,请参见
You need to use the class System.IO.Ports.SerialPort, please see http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx[^].

Generally, you will need to code an exchange protocol in a separate thread.

Everything else depends on the specification of your device on the other end of RS-232 cable.

—SA


这篇关于控制连接到串行端口的设备的亮度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆