如何使用I / O控制器控制LED灯 [英] How to control LED Light using I/O controller

查看:111
本文介绍了如何使用I / O控制器控制LED灯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用I / O控制器来控制/操作外部照明。

我不知道如何编写有关它的编程。我希望被C#Window Forms下的Radio Buttons使用。

请帮我提一下建议。

I want to control/Operate External Lighting using I/O Controller.
I don't know how to write programming about it. I want to be used by Radio Buttons under C# Window Forms.
Please help me to give advice.

推荐答案

  • 了解控制器的工厂文档;这是它的主要部分。
  • 找出用于控制的.NET API。如果它不可用,请使用本机API编写,这可能需要您知道P / Invoke:

    http://en.wikipedia.org/wiki/P/Invoke [ ^ ],

    http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp [ ^ ]。



    很可能,你的硬件运行良好已知的硬件接口(如串口),硬件级软件已经可用,您的API将只在应用程序级别上。
  • 如果您有.NET API,则可能需要为它编写一个包装器,封装您需要的主要功能部分,专注于您的应用程序
  • 开发一个用于测试API /包装器的简单应用程序。进行测试和修复bug。
  • 如果您的应用程序不是纯粹交互式的并且应该运行某些场景(比如显示文本选框),请在单独的线程中执行。如果必须,学习线程和线程同步。在大多数情况下,您确实需要它,并且迟早需要学习和使用。
  • 开发,测试和调试您的应用程序。
  • 利润!
  • Learn factory documentation for the controller; this is the main part of it.
  • Find out .NET API for control. If it is not available, write it using native API, which may require you to know P/Invoke:
    http://en.wikipedia.org/wiki/P/Invoke[^],
    http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp[^].

    Chances are, your hardware operates on well-known hardware interface (like serial port), then the hardware-level software is already available, and your API would be just on the application level.
  • If you got a .NET API, you may need to write a wrapper for it, encapsulating primary part of functionality you need, focusing on your application requirements.
  • Develop a simple application to be used to test the API/wrapper. Do the testing and bug fixing.
  • If your application is not purely interactive and should run some scenario (say, display text marquee), do it in a separate thread. If you have to, learn threading and thread synchronization. In most cases, you do need it, and will have to learn and use, sooner or later.
  • Develop, test and debug your application.
  • PROFIT!


这篇关于如何使用I / O控制器控制LED灯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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